在ubuntu上安装scikit learn

2024-04-25 14:23:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用cross_val_predict函数来获得使用scikit learn生成的二元分类器的精度。在

我使用的命令是:

from sklearn.model_selection import cross_val_predict

但我得到了以下错误:

^{pr2}$

我正在使用scikit learn 0.14.1版。 我尝试通过以下命令更新scikit learn版本:

pip install -U scikit-learn

但装置没有完成警告是:

/usr/lib/python2.7/dist packages/numpy/core/include/numpy/func_api.h:241:1:警告:''u import_umath'已定义但未使用[-Wunused function]

_import_umath(无效)

有人能帮我解决这个问题吗?在


Tags: 函数fromimport命令numpy警告分类器精度
1条回答
网友
1楼 · 发布于 2024-04-25 14:23:42

我不完全确定,但这似乎是工具/依赖关系的问题,您有两种选择:

1)最差(安装工具和依赖项):

$ Sudo apt-get install build-essential python-dev python-setuptools python-numpy python-scipy libatlas-dev libatlas3gf-base

然后再次尝试更新

2)最佳(使用水蟒):

Install Anaconda, use easily multiple python versions and difrerent envs, and be happy with scikit or any other scientific package.


Edit (04/25/17):
If your choice was the first option, try update scikit this way:

^{pr2}$

相关问题 更多 >