Skip to content

Commit 792c29d

Browse files
committed
iter
1 parent 427486a commit 792c29d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

imblearn/utils/estimator_checks.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from sklearn.utils.testing import assert_allclose
2626
from sklearn.utils.testing import set_random_state
2727

28-
from imblearn.base import SamplerMixin
2928
from imblearn.over_sampling.base import BaseOverSampler
3029
from imblearn.under_sampling.base import BaseCleaningSampler, BaseUnderSampler
3130
from imblearn.ensemble.base import BaseEnsembleSampler
@@ -34,8 +33,6 @@
3433

3534
from imblearn.utils.testing import warns
3635

37-
NOT_TESTED_SAMPLERS = ('FunctionSampler') # This is not a normal sampler
38-
3936

4037
def _yield_sampler_checks(name, Estimator):
4138
yield check_target_type
@@ -49,10 +46,10 @@ def _yield_sampler_checks(name, Estimator):
4946
yield check_samplers_pandas
5047

5148

52-
def _yield_all_checks(name, Estimator):
49+
def _yield_all_checks(name, estimator):
5350
# trigger our checks if this is a SamplerMixin
54-
if issubclass(Estimator, SamplerMixin):
55-
for check in _yield_sampler_checks(name, Estimator):
51+
if hasattr(estimator, 'sample'):
52+
for check in _yield_sampler_checks(name, estimator):
5653
yield check
5754

5855

@@ -75,7 +72,6 @@ def check_estimator(Estimator):
7572
sklearn_check_estimator(Estimator)
7673
check_parameters_default_constructible(name, Estimator)
7774
for check in _yield_all_checks(name, Estimator):
78-
# if name not in NOT_TESTED_SAMPLERS:
7975
check(name, Estimator)
8076

8177

0 commit comments

Comments
 (0)