8000 Replace sklearn estimator method _more_tags with __sklearn_tags__ · KhiopsML/khiops-python@fa82359 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa82359

Browse files
Replace sklearn estimator method _more_tags with __sklearn_tags__
This is an update to the estimator API which generates an error starting with scikit-learn 1.7. For details see scikit-learn/scikit-learn#28910
1 parent 34c6714 commit fa82359

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

khiops/sklearn/estimators.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,11 @@ def __init__(
268268
# Make sklearn get_params happy
269269
self.internal_sort = internal_sort
270270

271-
def _more_tags(self):
272-
return {"allow_nan": True, "accept_large_sparse": False}
271+
def __sklearn_tags__(self):
272+
tags = super().__sklearn_tags__()
273+
tags["allow_nan"] = True
274+
tags["accept_large_sparse"] = False
275+
return tags
273276

274277
def _undefine_estimator_attributes(self):
275278
"""Undefines all sklearn estimator attributes (ie. pass to "not fit" state)
@@ -1399,8 +1402,10 @@ def __init__(
13991402
)
14001403
)
14011404

1402-
def _more_tags(self):
1403-
return {"require_y": True}
1405+
def __sklearn_tags__(self):
1406+
tags = super().__sklearn_tags__()
1407+
tags["require_y"] = True
1408+
return tags
14041409

14051410
def _fit_check_dataset(self, ds):
14061411
super()._fit_check_dataset(ds)

0 commit comments

Comments
 (0)
0