Hyperactive icon indicating copy to clipboard operation
Hyperactive copied to clipboard

[MNT] compatibility issues with `scikit-learn 1.7.0`

Open SimonBlanke opened this issue 6 months ago • 2 comments

We have a problem: https://github.com/SimonBlanke/Hyperactive/actions/runs/15483542700/job/43593595699#step:5:53

Error: from sklearn.utils.deprecation import _deprecate_Xt_in_inverse_transform ImportError: cannot import name '_deprecate_Xt_in_inverse_transform' from 'sklearn.utils.deprecation'

This is what sklearn says about this: https://github.com/scikit-learn/scikit-learn/issues/29366

I had this error before: https://github.com/SimonBlanke/Hyperactive/pull/110#issuecomment-2870968142 Behoben durch ein sklearn upgrade.

Our CI test already used the newest version (from a few days ago) 1.7 of sklearn. I'll look into changes, that might be related to this.

SimonBlanke avatar Jun 09 '25 09:06 SimonBlanke

We should not be using private methods - why were we importing this in the first place?

fkiraly avatar Jun 09 '25 09:06 fkiraly

There are more issues caused by apparent changes in extender contract in sklearn 1.7.0. I will temporarily bound the dependency until this is fixed.

fkiraly avatar Jun 14 '25 16:06 fkiraly

One thing we noticed in in scikit-learn is the changing location of the validate_data function.

To enable compatibility with a wider version range of scikit-learn, we wrote a bridge that keeps the interface internally consitent across versions: https://github.com/sktime/sktime/blob/main/sktime/utils/sklearn/_version_bridge.py

We could copy this - for the _check_soft_dependencies, this is also available in skbase.utils.dependencies, to avoid taking a dep on sktime.

fkiraly avatar Jun 29 '25 09:06 fkiraly