Skip to content

Commit 4d99aad

Browse files
committed
fixup! Fix validate_data usage for new sklearn
1 parent db72468 commit 4d99aad

5 files changed

Lines changed: 28 additions & 7 deletions

File tree

HROCH/classifier.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,10 @@ def predict_proba(self, X, id=None, check_input=True):
288288
proba = numpy.vstack([1 - preds, preds]).T
289289
return proba
290290

291-
def _more_tags(self):
292-
return {'binary_only': True}
291+
def __sklearn_tags__(self):
292+
tags = super(ClassifierMixin, self).__sklearn_tags__()
293+
tags.binary_only = True
294+
return tags
293295

294296
class SymbolicClassifier(OneVsRestClassifier):
295297
"""
@@ -356,3 +358,6 @@ def predict_proba(self, X):
356358
classes corresponds to that in the attribute :term:`classes_`.
357359
"""
358360
return super().predict_proba(X)
361+
362+
def __sklearn_tags__(self):
363+
return super(OneVsRestClassifier, self).__sklearn_tags__()

HROCH/fuzzy.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ def _more_tags(self):
281281
'binary_only': True,
282282
'poor_score':True, # tests from check_estimator dont have fuzzy number type
283283
}
284+
285+
def __sklearn_tags__(self):
286+
tags = super(ClassifierMixin, self).__sklearn_tags__()
287+
tags.binary_only = True
288+
tags.poor_score = True
289+
return tags
284290

285291

286292
class FuzzyClassifier(OneVsRestClassifier):
@@ -349,7 +355,7 @@ def predict_proba(self, X):
349355
"""
350356
return super().predict_proba(X)
351357

352-
def _more_tags(self):
353-
return {
354-
'poor_score':True, # tests from check_estimator dont have fuzzy number type
355-
}
358+
def __sklearn_tags__(self):
359+
tags = super(OneVsRestClassifier, self).__sklearn_tags__()
360+
tags.poor_score = True
361+
return tags

HROCH/hroch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,3 +1022,6 @@ def __getstate__(self):
10221022
all_attributes['models_'] = self.get_models()
10231023
all_attributes.pop('handle_', None)
10241024
return all_attributes
1025+
1026+
def __sklearn_tags__(self):
1027+
return super().__sklearn_tags__()

HROCH/regressor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,6 @@ def predict(self, X, id=None, check_input=True, use_parsed_model=True):
224224
The predicted values.
225225
"""
226226
return super(SymbolicRegressor, self).predict(X, id=id, check_input=check_input, use_parsed_model=use_parsed_model)
227+
228+
def __sklearn_tags__(self):
229+
return super(RegressorMixin, self).__sklearn_tags__()

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,9 @@
121121
packages=['HROCH'],
122122
license='MIT',
123123
include_package_data=True,
124-
install_requires=['numpy', 'scikit-learn', 'scipy'],
124+
install_requires=[
125+
"numpy>=1.19.5",
126+
'scikit-learn>=1.6.0',
127+
"scipy>=1.6.0",
128+
],
125129
)

0 commit comments

Comments
 (0)