Skip to content

[BUG] scikit-learn 1.3 support #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
celestinoxp opened this issue Jun 30, 2023 · 14 comments · Fixed by #999
Closed

[BUG] scikit-learn 1.3 support #995

celestinoxp opened this issue Jun 30, 2023 · 14 comments · Fixed by #999

Comments

@celestinoxp
Copy link

celestinoxp commented Jun 30, 2023

File ~\anaconda3\lib\site-packages\imblearn\utils\_param_validation.py:908
    906 from sklearn.utils._param_validation import generate_valid_param  # noqa
    907 from sklearn.utils._param_validation import validate_parameter_constraints  # noqa
--> 908 from sklearn.utils._param_validation import (
    909     HasMethods,
    910     Hidden,
    911     Interval,
    912     Options,
    913     StrOptions,
    914     _ArrayLikes,
    915     _Booleans,
    916     _Callables,
    917     _CVObjects,
    918     _InstancesOf,
    919     _IterablesNotString,
    920     _MissingValues,
    921     _NoneConstraint,
    922     _PandasNAConstraint,
    923     _RandomStates,
    924     _SparseMatrices,
    925     _VerboseHelper,
    926     make_constraint,
    927     validate_params,
    928 )

ImportError: cannot import name '_MissingValues' from 'sklearn.utils._param_validation' (C:\Users\user\anaconda3\lib\site-packages\sklearn\utils\_param_validation.py)
@dbcSep03
Copy link

Yes, i am,how to fix it

@jowodo
Copy link

jowodo commented Jun 30, 2023

@dbcSep03: downgrade scikit-learn to 1.2.2

@celestinoxp
Copy link
Author

7 months without updates. why not update this package?
image

@glemaitre
Copy link
Member

7 months without updates. why not update this package?

Because it was no release of scikit-learn in-between so no need to update it.
You are welcome to fix the breaking change.

@vjp23
Copy link

vjp23 commented Jul 7, 2023

Thank you @glemaitre for the fix!

@dbcSep03
Copy link

dbcSep03 commented Jul 8, 2023

Thanks @pur80a

@AS12-as
Copy link

AS12-as commented Jul 10, 2023

facing the same issue I have try to unistall and re-install sckit learn as well as imblearn twice ut still facing same issue anyone please help me to resolve this issue

@glemaitre
Copy link
Member

@AS12-as you need to install imbalanced-learn 0.11 available on PyPI and the conda-forge channel.

@celestinoxp
Copy link
Author

@AS12-as
just to make sure there are no problems with the packages, as it happened to me:
pip uninstall scikit-learn -y
pip uninstall scikit-learn -y
pip uninstall imbalanced-learn -y
pip uninstall imbalanced-learn -y

the uninstall command was used 2 times to remove potential uninstall issues. the -y command, means to confirm without asking the user

Then go to the location where your packages are located, in my case, I use Windows, "C:\Users\username\anaconda3\Lib\site-packages", and look for a folder called sklearn, or scikit-learn and delete it, also look for some folder called imbalanced-learn or imblearn and delete it.

Then you just have to install the packages as usual:
pip install scikit-learn
pip install imbalanced-learn

Done, it should work...

@WyaShubu
Copy link

WyaShubu commented Dec 6, 2023

still not helping the issue

@TLCvra
Copy link

TLCvra commented Mar 12, 2024

@celestinoxp @glemaitre
Not working for me.
Uninstalled both packages, rolled back scikit-learn to 1.2 and installed imbalanced-learn 0.11 (following recommendations above and elsewhere). The problem with sklearn library unable to import the _MissingValues class from the sklearn.utils._param_validation module is still there.

@T-i-m-R-y-a-n
Copy link

this has been an issue for a while now, so I guess they're not gonna fix it

@EvanAad
Copy link

EvanAad commented Jun 2, 2024

I'm facing the same issue. I can't downgrade scikit-learn to 1.2.2, because I'm using the feature-engine library, which requires scikit-learn 1.3 or higher.

@glemaitre
Copy link
Member

Version 0.13 is supporting this version of sklearn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
10 participants