8000 MAINT Clean up deprecated Estimator in check_estimator for 1.3 (#26484) · scikit-learn/scikit-learn@b2f7e81 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2f7e81

Browse files
authored
MAINT Clean up deprecated Estimator in check_estimator for 1.3 (#26484)
1 parent b680a9e commit b2f7e81

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

sklearn/utils/estimator_checks.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def checks_generator():
546546
)
547547

548548

549-
def check_estimator(estimator=None, generate_only=False, Estimator="deprecated"):
549+
def check_estimator(estimator=None, generate_only=False):
550550
"""Check if estimator adheres to scikit-learn conventions.
551551
552552
This function will run an extensive test-suite for input validation,
@@ -582,13 +582,6 @@ def check_estimator(estimator=None, generate_only=False, Estimator="deprecated")
582582
583583
.. versionadded:: 0.22
584584
585-
Estimator : estimator object
586-
Estimator instance to check.
587-
588-
.. deprecated:: 1.1
589-
``Estimator`` was deprecated in favor of ``estimator`` in version 1.1
590-
and will be removed in version 1.3.
591-
592585
Returns
593586
-------
594587
checks_generator : generator
@@ -600,18 +593,6 @@ def check_estimator(estimator=None, generate_only=False, Estimator="deprecated")
600593
parametrize_with_checks : Pytest specific decorator for parametrizing estimator
601594
checks.
602595
"""
603-
604-
if estimator is None and Estimator == "deprecated":
605-
msg = "Either estimator or Estimator should be passed to check_estimator."
606-
raise ValueError(msg)
607-
608-
if Estimator != "deprecated":
609-
msg = (
610-
"'Estimator' was deprecated in favor of 'estimator' in version 1.1 "
611-
"and will be removed in version 1.3."
612-
)
613-
warnings.warn(msg, FutureWarning)
614-
estimator = Estimator
615596
if isinstance(estimator, type):
616597
msg = (
617598
"Passing a class was deprecated in version 0.23 "

sklearn/utils/tests/test_estimator_checks.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,19 +1121,6 @@ def fit(self, X, y):
11211121
assert not [r.message for r in record]
11221122

11231123

1124-
# TODO: Remove in 1.3 when Estimator is removed
1125-
def test_deprecated_Estimator_check_estimator():
1126-
err_msg = "'Estimator' was deprecated in favor of"
1127-
with warnings.catch_warnings():
1128-
warnings.simplefilter("error", FutureWarning)
1129-
with raises(FutureWarning, match=err_msg, may_pass=True):
1130-
check_estimator(Estimator=NuSVC())
1131-
1132-
err_msg = "Either estimator or Estimator should be passed"
1133-
with raises(ValueError, match=err_msg, may_pass=False):
1134-
check_estimator()
1135-
1136-
11371124
def test_non_deterministic_estimator_skip_tests():
11381125
# check estimators with non_deterministic tag set to True
11391126
# will skip certain tests, refer to issue #22313 for details

0 commit comments

Comments
 (0)
0