You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When using sklearn v0.23, some estimator checks fail #231
Describe the bug
It seems the way estimator tags are obtained has changed in sklearn since version 0.23 that was just released: some tests that used to pass are now failing because of missing tags.
So currently e.g. GlobalAlignmentKernelKMeans()._get_tags() returns {'allow_nan': True, 'allow_variable_length': True} and so it doesn't include all the default tags from the BaseEstimator. To make it work we would need instead to do define GlobalAlignmentKernelKMeans._more_tags with those values and then _get_tags would be inherited from BaseEstimator.
Another point I think is that would make sense to run estimator tests only for one last version of scikit-learn. Estimator checks still evolve and supporting more than one version would be difficult.
Also we should get rid of _safe_tags in tslearn in favor of just using estimator._get_tags. That's why these checks break I think, because we stopped using _safe_tags in estimator checks in scikit-learn. This may require re-ordering mixing so e.g.,
Thanks a lot @rth for this detailed answer! I will then open a PR implementing those changes. Also, I'll need to think about how to provide default value for 'allow_variable_length' key.
Another point I think is that would make sense to run estimator tests only for one last version of scikit-learn. Estimator checks still evolve and supporting more than one version would be difficult.
And maybe it would also make sense to have all other tests run for our matrix of (python_versions x OS) but have estimator checks only for one configuration (Python version, OS, sklearn version)? That would save a lot of computations.
Activity
rtavenar commentedon May 15, 2020
@rth @GillesVandewiele any idea what could cause this? I couldn't see anything related in the changelog, and
DEFAULT_TAGSstill hasbinary_onlykey in sklearn master: https://github.com/scikit-learn/scikit-learn/blob/90d00daa76d1c6848a60554c7eba15f1e351ed46/sklearn/base.py#L23rth commentedon May 15, 2020
So currently e.g.
GlobalAlignmentKernelKMeans()._get_tags()returns{'allow_nan': True, 'allow_variable_length': True}and so it doesn't include all the default tags from theBaseEstimator. To make it work we would need instead to do defineGlobalAlignmentKernelKMeans._more_tagswith those values and then_get_tagswould be inherited from BaseEstimator.Another point I think is that would make sense to run estimator tests only for one last version of scikit-learn. Estimator checks still evolve and supporting more than one version would be difficult.
Also we should get rid of
_safe_tagsin tslearn in favor of just usingestimator._get_tags. That's why these checks break I think, because we stopped using_safe_tagsin estimator checks in scikit-learn. This may require re-ordering mixing so e.g.,should be
because method order resolution (MRO) in python is left to right, and we want for
BaseEstimatorto be last. It was in the 0.22 release notes,Opened scikit-learn/scikit-learn#17232 to improve the documentation about it.
rtavenar commentedon May 15, 2020
Thanks a lot @rth for this detailed answer! I will then open a PR implementing those changes. Also, I'll need to think about how to provide default value for
'allow_variable_length'key.rtavenar commentedon May 15, 2020
And maybe it would also make sense to have all other tests run for our matrix of (python_versions x OS) but have estimator checks only for one configuration (Python version, OS, sklearn version)? That would save a lot of computations.
rth commentedon May 15, 2020
I agree that it' probably not that useful to run them on all OS versions.