sklearn安装

1、准备工作

安装sklearn之前,我们需要先安装numpyscipy函数库。

由于用pip install numpy, scipy大概率安装失败(Win下),一个简单的解决方法是安装UCI第三方库——

教程参见Python安装SciPy

用到,「非官方的Windows二进制文件Python扩展包(Unofficial Windows Binaries for python Extension Packages)」

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy 

#安装完成后,

然后可以在python下执行相应的测试程序:

python

>>> import numpy

>>> import scipy

>>> numpy.test('full')

等待。。。。

>>> scipy.test('full')

2、安装sklearn机器学习库

下载地址:https://github.com/scikit-learn/scikit-learn

下载压缩包之后,解该压缩包压缩。使用CMD进入sklearn文件夹,执行

pip install -U scikit-learn

#参数-U:pip install -h 就有说明了,就是 --upgrade,意思是如果已安装就升级到最新版。

3. scikit-learn库简介

http://scikit-learn.org/stable/

建立在NumPy,SciPy和matplotlib上,Python中的机器学习库,简单高效的数据挖掘和数据分析工具。

功能有分类(SVM,nearest neighbors,random forest等),回归(SVR, ridge regression, Lasso等),聚类(k-Means, spectral clustering, mean-shift等),降维(PCA, feature selection, non-negative matrix factorization等),选择模型(grid search, cross validation, metrics等),预处理(preprocessing, feature extraction等)。

原文地址:https://www.cnblogs.com/eniac1946/p/7364643.html