Skip to content

Commit 5d12d07

Browse files
committed
more fix
1 parent 7c91d5d commit 5d12d07

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

imblearn/metrics/pairwise.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,9 @@ def _more_tags(self):
235235
return {
236236
"requires_positive_X": True, # X should be encoded with OrdinalEncoder
237237
}
238+
239+
@available_if(check_version_package("sklearn", ">=", "1.6"))
240+
def __sklearn_tags__(self):
241+
tags = super().__sklearn_tags__()
242+
tags.input_tags.positive_only = True # X should be encoded with OrdinalEncoder
243+
return tags

imblearn/tests/test_docstring_parameters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
)
1919
from sklearn.utils.deprecation import _is_deprecated
2020
from sklearn.utils.estimator_checks import (
21-
_construct_instance,
2221
_enforce_estimator_tags_X,
2322
_enforce_estimator_tags_y,
2423
)
@@ -27,6 +26,7 @@
2726
from imblearn.base import is_sampler
2827
from imblearn.utils.estimator_checks import _set_checking_parameters
2928
from imblearn.utils.testing import all_estimators
29+
from imblearn.utils._test_common.instance_generator import _construct_instances
3030

3131
# walk_packages() ignores DeprecationWarnings, now we need to ignore
3232
# FutureWarnings
@@ -179,7 +179,7 @@ def test_fit_docstring_attributes(name, Estimator):
179179
if Estimator.__name__ == "Pipeline":
180180
est = _construct_compose_pipeline_instance(Estimator)
181181
else:
182-
est = _construct_instance(Estimator)
182+
est = next(_construct_instances(Estimator))
183183
_set_checking_parameters(est)
184184

185185
X, y = make_classification(

0 commit comments

Comments
 (0)