diff --git a/docs/requirements.txt b/docs/requirements.txt index 5cec0eaa0..574b8ea58 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ # Library Dependencies matplotlib>=3.3 scipy>=1.6.0 -scikit-learn>=0.24 +scikit-learn>=1.0.0 numpy>=1.16.0 cycler>=0.10.0 diff --git a/requirements.txt b/requirements.txt index 292296e1d..c9492898b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ ## Dependencies matplotlib>=2.0.2,!=3.0.0 scipy>=1.0.0 -scikit-learn>=0.20 +scikit-learn>=1.0.0 numpy>=1.16.0 cycler>=0.10.0 diff --git a/tests/baseline_images/test_classifier/test_threshold/test_binary_discrimination_threshold.png b/tests/baseline_images/test_classifier/test_threshold/test_binary_discrimination_threshold.png index e570fc22a..3628e0c6b 100644 Binary files a/tests/baseline_images/test_classifier/test_threshold/test_binary_discrimination_threshold.png and b/tests/baseline_images/test_classifier/test_threshold/test_binary_discrimination_threshold.png differ diff --git a/tests/baseline_images/test_classifier/test_threshold/test_quick_method.png b/tests/baseline_images/test_classifier/test_threshold/test_quick_method.png index 77177d7bc..747c79822 100644 Binary files a/tests/baseline_images/test_classifier/test_threshold/test_quick_method.png and b/tests/baseline_images/test_classifier/test_threshold/test_quick_method.png differ diff --git a/tests/baseline_images/test_cluster/test_elbow/test_integrated_kmeans_elbow.png b/tests/baseline_images/test_cluster/test_elbow/test_integrated_kmeans_elbow.png index 715889aee..30e3c634f 100644 Binary files a/tests/baseline_images/test_cluster/test_elbow/test_integrated_kmeans_elbow.png and b/tests/baseline_images/test_cluster/test_elbow/test_integrated_kmeans_elbow.png differ diff --git a/tests/baseline_images/test_cluster/test_elbow/test_integrated_mini_batch_kmeans_elbow.png b/tests/baseline_images/test_cluster/test_elbow/test_integrated_mini_batch_kmeans_elbow.png index 871ec7ecd..703c062b3 100644 Binary files a/tests/baseline_images/test_cluster/test_elbow/test_integrated_mini_batch_kmeans_elbow.png and b/tests/baseline_images/test_cluster/test_elbow/test_integrated_mini_batch_kmeans_elbow.png differ diff --git a/tests/baseline_images/test_cluster/test_elbow/test_quick_method.png b/tests/baseline_images/test_cluster/test_elbow/test_quick_method.png index ccbbcf3f9..3515630e8 100644 Binary files a/tests/baseline_images/test_cluster/test_elbow/test_quick_method.png and b/tests/baseline_images/test_cluster/test_elbow/test_quick_method.png differ diff --git a/tests/baseline_images/test_cluster/test_icdm/test_quick_method.png b/tests/baseline_images/test_cluster/test_icdm/test_quick_method.png index 61789767c..29b3d1895 100644 Binary files a/tests/baseline_images/test_cluster/test_icdm/test_quick_method.png and b/tests/baseline_images/test_cluster/test_icdm/test_quick_method.png differ diff --git a/tests/baseline_images/test_cluster/test_silhouette/test_colormap_as_colors_silhouette.png b/tests/baseline_images/test_cluster/test_silhouette/test_colormap_as_colors_silhouette.png index c903d06c8..1133e8455 100644 Binary files a/tests/baseline_images/test_cluster/test_silhouette/test_colormap_as_colors_silhouette.png and b/tests/baseline_images/test_cluster/test_silhouette/test_colormap_as_colors_silhouette.png differ diff --git a/tests/baseline_images/test_cluster/test_silhouette/test_colormap_silhouette.png b/tests/baseline_images/test_cluster/test_silhouette/test_colormap_silhouette.png index c5a5156d5..bf4a0c090 100644 Binary files a/tests/baseline_images/test_cluster/test_silhouette/test_colormap_silhouette.png and b/tests/baseline_images/test_cluster/test_silhouette/test_colormap_silhouette.png differ diff --git a/tests/baseline_images/test_cluster/test_silhouette/test_colors_silhouette.png b/tests/baseline_images/test_cluster/test_silhouette/test_colors_silhouette.png index 79e6d6486..c292d91c4 100644 Binary files a/tests/baseline_images/test_cluster/test_silhouette/test_colors_silhouette.png and b/tests/baseline_images/test_cluster/test_silhouette/test_colors_silhouette.png differ diff --git a/tests/baseline_images/test_cluster/test_silhouette/test_integrated_mini_batch_kmeans_silhouette.png b/tests/baseline_images/test_cluster/test_silhouette/test_integrated_mini_batch_kmeans_silhouette.png index 367c4eb57..90066eaeb 100644 Binary files a/tests/baseline_images/test_cluster/test_silhouette/test_integrated_mini_batch_kmeans_silhouette.png and b/tests/baseline_images/test_cluster/test_silhouette/test_integrated_mini_batch_kmeans_silhouette.png differ diff --git a/tests/baseline_images/test_cluster/test_silhouette/test_quick_method.png b/tests/baseline_images/test_cluster/test_silhouette/test_quick_method.png index 89cd45445..0c08a484d 100644 Binary files a/tests/baseline_images/test_cluster/test_silhouette/test_quick_method.png and b/tests/baseline_images/test_cluster/test_silhouette/test_quick_method.png differ diff --git a/tests/baseline_images/test_features/test_manifold/test_manifold_quick_method_continuous_target.png b/tests/baseline_images/test_features/test_manifold/test_manifold_quick_method_continuous_target.png index 22784f34d..8a259c79a 100644 Binary files a/tests/baseline_images/test_features/test_manifold/test_manifold_quick_method_continuous_target.png and b/tests/baseline_images/test_features/test_manifold/test_manifold_quick_method_continuous_target.png differ diff --git a/tests/baseline_images/test_features/test_manifold/test_manifold_regression.png b/tests/baseline_images/test_features/test_manifold/test_manifold_regression.png index 6d497c2df..f770fb521 100644 Binary files a/tests/baseline_images/test_features/test_manifold/test_manifold_regression.png and b/tests/baseline_images/test_features/test_manifold/test_manifold_regression.png differ diff --git a/tests/baseline_images/test_features/test_manifold/test_manifold_regression_3d.png b/tests/baseline_images/test_features/test_manifold/test_manifold_regression_3d.png index ae65873b4..15aba1392 100644 Binary files a/tests/baseline_images/test_features/test_manifold/test_manifold_regression_3d.png and b/tests/baseline_images/test_features/test_manifold/test_manifold_regression_3d.png differ diff --git a/tests/baseline_images/test_meta/test_random_visualizer_not_close.png b/tests/baseline_images/test_meta/test_random_visualizer_not_close.png index 4b92c63ab..13d22d7fa 100644 Binary files a/tests/baseline_images/test_meta/test_random_visualizer_not_close.png and b/tests/baseline_images/test_meta/test_random_visualizer_not_close.png differ diff --git a/tests/baseline_images/test_model_selection/test_importances/test_topn.png b/tests/baseline_images/test_model_selection/test_importances/test_topn.png index eb6750546..b355d554c 100644 Binary files a/tests/baseline_images/test_model_selection/test_importances/test_topn.png and b/tests/baseline_images/test_model_selection/test_importances/test_topn.png differ diff --git a/tests/baseline_images/test_model_selection/test_importances/test_topn_negative.png b/tests/baseline_images/test_model_selection/test_importances/test_topn_negative.png index d48b9e5a7..cb91a1dc2 100644 Binary files a/tests/baseline_images/test_model_selection/test_importances/test_topn_negative.png and b/tests/baseline_images/test_model_selection/test_importances/test_topn_negative.png differ diff --git a/tests/baseline_images/test_model_selection/test_learning_curve/test_clusters.png b/tests/baseline_images/test_model_selection/test_learning_curve/test_clusters.png index b6e1aa081..2cf04ccd3 100644 Binary files a/tests/baseline_images/test_model_selection/test_learning_curve/test_clusters.png and b/tests/baseline_images/test_model_selection/test_learning_curve/test_clusters.png differ diff --git a/tests/baseline_images/test_regressor/test_prediction_error/test_prediction_error.png b/tests/baseline_images/test_regressor/test_prediction_error/test_prediction_error.png index 48b0457d0..c7f0f9ebf 100644 Binary files a/tests/baseline_images/test_regressor/test_prediction_error/test_prediction_error.png and b/tests/baseline_images/test_regressor/test_prediction_error/test_prediction_error.png differ diff --git a/tests/baseline_images/test_text/test_tsne/test_integrated_tsne.png b/tests/baseline_images/test_text/test_tsne/test_integrated_tsne.png index 4a4b87d4a..574541c3e 100644 Binary files a/tests/baseline_images/test_text/test_tsne/test_integrated_tsne.png and b/tests/baseline_images/test_text/test_tsne/test_integrated_tsne.png differ diff --git a/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne.png b/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne.png index 8b2d4352b..50dbf9ad5 100644 Binary files a/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne.png and b/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne.png differ diff --git a/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne_class_labels.png b/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne_class_labels.png index 8b2d4352b..50dbf9ad5 100644 Binary files a/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne_class_labels.png and b/tests/baseline_images/test_text/test_tsne/test_make_classification_tsne_class_labels.png differ diff --git a/tests/baseline_images/test_text/test_tsne/test_no_target_tsne.png b/tests/baseline_images/test_text/test_tsne/test_no_target_tsne.png index 7ccaf82b2..f203c7594 100644 Binary files a/tests/baseline_images/test_text/test_tsne/test_no_target_tsne.png and b/tests/baseline_images/test_text/test_tsne/test_no_target_tsne.png differ diff --git a/tests/baseline_images/test_text/test_tsne/test_quick_method.png b/tests/baseline_images/test_text/test_tsne/test_quick_method.png index f1caf7bac..59718e281 100644 Binary files a/tests/baseline_images/test_text/test_tsne/test_quick_method.png and b/tests/baseline_images/test_text/test_tsne/test_quick_method.png differ diff --git a/tests/baseline_images/test_text/test_tsne/test_visualizer_with_pandas.png b/tests/baseline_images/test_text/test_tsne/test_visualizer_with_pandas.png index 2c6c1926f..1e0ae1b47 100644 Binary files a/tests/baseline_images/test_text/test_tsne/test_visualizer_with_pandas.png and b/tests/baseline_images/test_text/test_tsne/test_visualizer_with_pandas.png differ diff --git a/tests/rand.py b/tests/rand.py index 4e3288496..96f29aa65 100644 --- a/tests/rand.py +++ b/tests/rand.py @@ -73,7 +73,7 @@ def generate(self): Center/blob each point belongs to (used for color) """ return make_blobs( - self.n_samples, 2, self.n_blobs, random_state=self.random_state + n_samples=self.n_samples, n_features=2, centers=self.n_blobs, random_state=self.random_state ) def fit(self, *args, **kwargs): diff --git a/tests/requirements.txt b/tests/requirements.txt index c2ebff8db..a262b1465 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -6,7 +6,7 @@ # Library Dependencies matplotlib==3.4.2 scipy==1.7.0 -scikit-learn==0.24.2 +scikit-learn==1.0.0 numpy==1.21.0 cycler==0.10.0 @@ -25,4 +25,4 @@ umap-learn==0.5.1 # Third-Party Estimator Tests # xgboost==1.2.0 -# catboost==0.24.1 \ No newline at end of file +# catboost==0.24.1 diff --git a/tests/test_base.py b/tests/test_base.py index 88eadc059..6d102c63f 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -318,7 +318,7 @@ def test_draw_visualizer_grid(self): # show is required here (do not replace with finalize)! assert grid.show() is not None - self.assert_images_similar(grid) + self.assert_images_similar(grid, tol=1.0) @pytest.mark.xfail( IS_WINDOWS_OR_CONDA, @@ -340,7 +340,7 @@ def test_draw_with_rows(self): # show is required here (do not replace with finalize)! assert grid.show() is not None - self.assert_images_similar(grid) + self.assert_images_similar(grid, tol=1.0) @pytest.mark.xfail( IS_WINDOWS_OR_CONDA, @@ -362,7 +362,7 @@ def test_draw_with_cols(self): # show is required here (do not replace with finalize)! assert grid.show() is not None - self.assert_images_similar(grid) + self.assert_images_similar(grid, tol=1.0) def test_cant_define_both_rows_cols(self): """ diff --git a/tests/test_classifier/test_threshold.py b/tests/test_classifier/test_threshold.py index 82352138c..2b2138406 100644 --- a/tests/test_classifier/test_threshold.py +++ b/tests/test_classifier/test_threshold.py @@ -71,7 +71,7 @@ def test_binary_discrimination_threshold(self): _, ax = plt.subplots() - model = BernoulliNB(3) + model = BernoulliNB() visualizer = DiscriminationThreshold(model, ax=ax, random_state=23) visualizer.fit(X, y) @@ -161,7 +161,7 @@ def test_quick_method(self): _, ax = plt.subplots() - discrimination_threshold(BernoulliNB(3), X, y, ax=ax, random_state=5, show=False) + discrimination_threshold(BernoulliNB(), X, y, ax=ax, random_state=5, show=False) self.assert_images_similar(ax=ax, tol=10) @patch.object(DiscriminationThreshold, "draw", autospec=True) @@ -232,7 +232,7 @@ def test_threshold_default_initialization(self): """ Test initialization default parameters """ - model = BernoulliNB(3) + model = BernoulliNB() viz = DiscriminationThreshold(model) assert viz.estimator is model assert viz.color is None diff --git a/tests/test_cluster/test_icdm.py b/tests/test_cluster/test_icdm.py index 72fb7c17f..fe5c5d2f6 100644 --- a/tests/test_cluster/test_icdm.py +++ b/tests/test_cluster/test_icdm.py @@ -270,7 +270,7 @@ def test_legend_matplotlib_version(self, mock_toolkit): """ ValueError is raised when matplotlib version is incorrect and legend=True """ - with pytst.raises(ImportError): + with pytest.raises(ImportError): from mpl_toolkits.axes_grid1 import inset_locator assert not inset_locator diff --git a/tests/test_meta.py b/tests/test_meta.py index 2d86600e7..e82afd94b 100644 --- a/tests/test_meta.py +++ b/tests/test_meta.py @@ -117,7 +117,7 @@ def test_image_comparison_not_in_assertion(self): def test_missing_baseline_image(self): """ - Test that a missing basline image raises an exception + Test that a missing baseline image raises an exception """ viz = RandomVisualizer(random_state=14).fit() viz.finalize() @@ -154,7 +154,7 @@ def test_random_visualizer_not_close(self): """ # Baseline image random_state=224 # NOTE: if regenerating baseline images, skip this one or change random state! - viz = RandomVisualizer(random_state=225).fit() + viz = RandomVisualizer(random_state=224).fit() viz.finalize() with pytest.raises(ImageComparisonFailure, match="images not close"): diff --git a/tests/test_model_selection/test_importances.py b/tests/test_model_selection/test_importances.py index c0521aac7..4f20c3aad 100644 --- a/tests/test_model_selection/test_importances.py +++ b/tests/test_model_selection/test_importances.py @@ -228,7 +228,7 @@ def test_multi_coefs_stacked(self): """ Test stack plot with multidimensional coefficients """ - X, y = load_iris(True) + X, y = load_iris(return_X_y=True) viz = FeatureImportances( LogisticRegression(solver="liblinear", random_state=222), stack=True @@ -455,7 +455,7 @@ def test_topn_stacked(self): Test stack plot with only the three most important features by sum of each feature's importance across all classes """ - X, y = load_iris(True) + X, y = load_iris(return_X_y=True) viz = FeatureImportances( LogisticRegression(solver="liblinear", random_state=222), @@ -473,7 +473,7 @@ def test_topn_negative_stacked(self): Test stack plot with only the three least important features by sum of each feature's importance across all classes """ - X, y = load_iris(True) + X, y = load_iris(return_X_y=True) viz = FeatureImportances( LogisticRegression(solver="liblinear", random_state=222), @@ -490,7 +490,7 @@ def test_topn(self): """ Test plot with only top three important features by absolute value """ - X, y = load_iris(True) + X, y = load_iris(return_X_y=True) viz = FeatureImportances( GradientBoostingClassifier(random_state=42), topn=3 @@ -505,7 +505,7 @@ def test_topn_negative(self): """ Test plot with only the three least important features by absolute value """ - X, y = load_iris(True) + X, y = load_iris(return_X_y=True) viz = FeatureImportances( GradientBoostingClassifier(random_state=42), topn=-3