我正在尝试代码from sklearn.datasets import load_iris
。为此,我在 python 2.7.6 中安装了 sklearn 模块,但它显示了很长的错误
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
from sklearn.datasets import load_iris
File "C:\Python27\lib\site-packages\sklearn\datasets\__init__.py", line 23, in <module>
from .twenty_newsgroups import fetch_20newsgroups
File "C:\Python27\lib\site-packages\sklearn\datasets\twenty_newsgroups.py", line 53, in <module>
from ..feature_extraction.text import CountVectorizer
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\__init__.py", line 10, in <module>
from . import text
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\text.py", line 24, in <module>
from ..preprocessing import normalize
File "C:\Python27\lib\site-packages\sklearn\preprocessing\__init__.py", line 6, in <module>
from ._function_transformer import FunctionTransformer
File "C:\Python27\lib\site-packages\sklearn\preprocessing\_function_transformer.py", line 2, in <module>
from ..utils import check_array
ImportError: cannot import name check_array
我想知道安装 sklearn 模块是否足够,还是我遗漏了什么?请帮忙。我也在Win 8.1上工作
最佳答案
当最新版本是0.18时,为什么你使用sklearn 0.13.1?您已经过时了,并且可能存在依赖性问题。
如果您想要更轻松的生活,请安装 anaconda。所有软件包版本都可以协同工作,无需编译任何内容。
关于python - Sklearn 数据集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41336094/