简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM