Amir
Amir

Reputation: 1

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

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.

Upvotes: 0

Views: 10878

Answers (2)

asaca
asaca

Reputation: 11

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

Upvotes: 1

Amey
Amey

Reputation: 480

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

Upvotes: 3

Related Questions