这里写自定义目录标题
python使用imblearn报错,当我想导入SMOTE报错
D:\programfiles\Anaconda\envs\deepLearning\lib\site-packages\imblearn\base.py in
10 import numpy as np
11 from sklearn.base import BaseEstimator
---> 12 from sklearn.externals import six
13 from sklearn.utils import check_X_y
14 from sklearn.utils.multiclass import type_of_target
ImportError: cannot import name 'six'
[6]
解决方案:
https://stackoverflow.com/questions/61901365/modulenotfounderror-no-module-named-sklearn-externals-six
Downgrade your scikit-learn version:
In jupyter notebook try !pip install --upgrade scikit-learn==0.20.3
or in terminal try pip install --upgrade scikit-learn==0.20.3
After that the code will recognize the sklearn.external.six module.
也就是说目前的sklearn版本过高,导致不能使用
进行退级更新即可。