Scikti简介
SciKit将经典的机器学习算法将机器学习作为一个module整合到Python中。它为科学和工程应用提供了简单有效的机器学习解决方案。
1.安装scikit-learn
有以下几种方式获取安装scikit-learn的方式:
1.1 安装发行版
- 第一种是操作系统自带了scikit-learn,这种方式最快
- Install an official release.这是发行的稳定版本。
- Install the latest development version. 这是包含了最新特性的开发版
1.1.1 从源代码安装
安装的前提条件:
安装 python (>= 2.6),
numpy(>= 1.3),
scipy (>= 0.7),
setuptools,
python development headers
C++ compile,
Debian系统 通 过以下命令安装:
sudo apt-get install python-dev python-numpy python-numpy-dev python-setuptools python-numpy-dev python-scipy libatlas-dev g++ 为了编译文档,并且运行文档中的例子,还需要安装matplotlib:sudo apt-get install python-matplotlib
1.1.1.1 快速安装
使用 pip install -U scikit-learn
或者 easy_install -U scikit-learn
1.1.1.2 从代码安装
源码地址: http://pypi.python.org/pypi/scikit-learn/, 解压。
cd到当前目录,键入命令:python setup.py install
1.1.2 windows下安装
参看:http://scikit-learn.org/stable/install.html#installing-an-official-release
1.2 第三方发行版
适用与ubuntu等 Debian and derivatives 系统 apt-get install python-sklearn
Python(x, y)版本包含了scikit-learn作为一个插件
1.3 测试
键入命令: nosetests sklearn --exe
得到输出:
Ran 601 tests in 27.920s
OK (SKIP=2)