Skip to content

Commit

Permalink
Updates sklearn to v1.0.0 (#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwgray authored Feb 18, 2022
1 parent 20acdcc commit df45161
Show file tree
Hide file tree
Showing 34 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_cluster/test_icdm/test_quick_method.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_text/test_tsne/test_no_target_tsne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_text/test_tsne/test_quick_method.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/rand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -25,4 +25,4 @@ umap-learn==0.5.1

# Third-Party Estimator Tests
# xgboost==1.2.0
# catboost==0.24.1
# catboost==0.24.1
6 changes: 3 additions & 3 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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):
"""
Expand Down
6 changes: 3 additions & 3 deletions tests/test_classifier/test_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cluster/test_icdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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"):
Expand Down
10 changes: 5 additions & 5 deletions tests/test_model_selection/test_importances.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit df45161

Please sign in to comment.