ImportError: cannot import name '_ClassNamePrefixFeaturesOutMixin' from 'sklearn.base'

10.4k views Asked by At

I am struggling to import RFECV from sklearn.feature_selection. But I always have the same error. Can anyone help, please? The error :

ImportError: cannot import name '_ClassNamePrefixFeaturesOutMixin' from 'sklearn.base' (C:\Users\sedam\anaconda34\lib\site-packages\sklearn\base.py)

PS. The version of my SKlearn is 1.0.2. Thanks.

2

There are 2 answers

0
Amey On

Well, there might be an issue with the python version you're using or a compatibility error with other packages.

For Windows, I'm afraid this might or mightn't work don't know haven't used it.

  1. If you're on Python 3.10.* try with 3.9.*:
conda install python=3.9 -y ;
conda update conda -y && conda update python -y
  1. Or else you can make a new env named sklearn or whatever: I'm creating mine with meow
conda create --name meow python=3.9 -y ;
conda activate meow ;
conda install python=3.9 -y ;
conda install numpy pandas matplotlib seaborn scikit-learn ipykernel -y
  1. Or just simple Update conda and python if you are on 3.9.*:
conda update conda -y && conda update python -y
2
asaca On

solution : #conda install -c conda-forge imbalanced-learn