我试图在Google Colab中导入数据(如下所示)
from imblearn.datasets import make_imbalance
但是我得到的输出是:
/usr/local/lib/python3.6/dist-packages/sklearn/externals/six.py:31: FutureWarning: The module is deprecated in version 0.21 and will be removed in version 0.23 since we've dropped support for Python 2.7. Please rely on the official version of six (https://pypi.org/project/six/).
"(https://pypi.org/project/six/).", FutureWarning)
/usr/local/lib/python3.6/dist-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.neighbors.base module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.neighbors. Anything that cannot be imported from sklearn.neighbors is now part of the private API.
warnings.warn(message, FutureWarning)
/usr/local/lib/python3.6/dist-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.datasets.base module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.datasets. Anything that cannot be imported from sklearn.datasets is now part of the private API.
warnings.warn(message, FutureWarning)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-5e38d91da46a> in <module>()
----> 1 from imblearn.datasets import make_imbalance
1 frames
/usr/local/lib/python3.6/dist-packages/imblearn/datasets/_zenodo.py in <module>()
58 from sklearn.datasets import get_data_home
59 from sklearn.datasets.base import Bunch
---> 60 from sklearn.utils.fixes import makedirs
61 from sklearn.externals import six
62 from sklearn.utils import check_random_state
ImportError: cannot import name 'makedirs'
我已尝试搜索该问题30分钟,但未取得任何进展。谁能帮我?
我找到了解决方法。只是这样做:
pip install -U imbalanced-learn
一切都会正常。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句