python - Sklearn 数据集

标签 python machine-learning scipy scikit-learn

我正在尝试代码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/

相关文章:

python - 如何使用经过训练的 Keras GRU 模型预测新的数据系列?

python - 打开文本文件时"OSError: [Errno 36] File name too long"

python - 黑盒脚本执行?

machine-learning - MahoutRecommenditembased 中相似性策略之间的差异

python - 为什么 scipy.ststs.contingency.expected_freq 返回的预期频率不是我所期望的?

python - 图像数据的 numpy 形状的维度顺序是什么?

python - 组合步骤

python - 如何返回和传递数组?

python - 在 Python 中使用对象的最佳方式?

image-processing - 将图像限制为某些颜色的方法