8000 MAINT Clean up leftovers from previous deprecations clean up PRs (#26… · scikit-learn/scikit-learn@168b4e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 168b4e7

Browse files
jeremiedbbogrisel
andauthored
MAINT Clean up leftovers from previous deprecations clean up PRs (#26545)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
1 parent 99c9f41 commit 168b4e7

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

sklearn/decomposition/_dict_learning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2412,7 +2412,7 @@ def fit(self, X, y=None):
24122412
self.n_steps_ = i + 1
24132413
self.n_iter_ = np.ceil(self.n_steps_ / n_steps_per_iter)
24142414
else:
2415-
# TODO remove this branch in 1.3
2415+
# TODO remove this branch in 1.4
24162416
n_iter = 1000 if self.n_iter == "deprecated" else self.n_iter
24172417

24182418
batches = gen_batches(n_samples, self._batch_size)

sklearn/metrics/tests/test_pairwise.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ def callable_rbf_kernel(x, y, **kwds):
301301
return K
302302

303303

304-
# TODO: Remove filterwarnings in 1.3 when wminkowski is removed
305< 10000 /td>-
@pytest.mark.filterwarnings("ignore:WMinkowskiDistance:FutureWarning:sklearn")
306304
@pytest.mark.parametrize(
307305
"func, metric, kwds",
308306
[

sklearn/neighbors/tests/test_neighbors.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,8 +2120,6 @@ def test_auto_algorithm(X, metric, metric_params, expected_algo):
21202120
assert model._fit_method == expected_algo
21212121

21222122

2123-
# TODO: Remove filterwarnings in 1.3 when wminkowski is removed
2124-
@pytest.mark.filterwarnings("ignore:WMinkowskiDistance:FutureWarning:sklearn")
21252123
@pytest.mark.parametrize(
21262124
"metric", sorted(set(neighbors.VALID_METRICS["brute"]) - set(["precomputed"]))
21272125
)

sklearn/tests/test_docstring_parameters.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def _construct_sparse_coder(Estimator):
197197
return Estimator(dictionary=dictionary)
198198

199199

200+
@ignore_warnings(category=sklearn.exceptions.ConvergenceWarning)
200201
@pytest.mark.parametrize("name, Estimator", all_estimators())
201202
def test_fit_docstring_attributes(name, Estimator):
202203
pytest.importorskip("numpydoc")
@@ -240,18 +241,6 @@ def test_fit_docstring_attributes(name, Estimator):
240241
# default raises an error, perplexity must be less than n_samples
241242
est.set_params(perplexity=2)
242243

243-
# FIXME: TO BE REMOVED for 1.3 (avoid FutureWarning)
244-
if Estimator.__name__ == "SequentialFeatureSelector":
245-
est.set_params(n_features_to_select="auto")
246-
247-
# FIXME: TO BE REMOVED for 1.3 (avoid FutureWarning)
248-
if Estimator.__name__ == "FastICA":
249-
est.set_params(whiten="unit-variance")
250-
251-
# FIXME: TO BE REMOVED for 1.3 (avoid FutureWarning)
252-
if Estimator.__name__ == "MiniBatchDictionaryLearning":
253-
est.set_params(batch_size=5)
254-
255244
# TODO(1.4): TO BE REMOVED for 1.4 (avoid FutureWarning)
256245
if Estimator.__name__ in ("KMeans", "MiniBatchKMeans"):
257246
est.set_params(n_init="auto")
@@ -277,6 +266,14 @@ def test_fit_docstring_attributes(name, Estimator):
277266
if Estimator.__name__ == "MDS":
278267
est.set_params(normalized_stress="auto")
279268

269+
# Low max iter to speed up tests: we are only interested in checking the existence
270+
# of fitted attributes. This should be invariant to whether it has converged or not.
271+
if "max_iter" in est.get_params():
272+
est.set_params(max_iter=2)
273+
274+
if "random_state" in est.get_params():
275+
est.set_params(random_state=0)
276+
280277
# In case we want to deprecate some attributes in the future
281278
skipped_attributes = {}
282279

0 commit comments

Comments
 (0)
0