博客网站seo,优化精灵,线上销售平台,wordpress去掉文章rssscikit-learn 是一个python实现的免费开源的机器学习算法包#xff0c;从字面意思可知#xff0c;science 代表科学#xff0c;kit代表工具箱#xff0c;直接翻译过来就是用于机器学习的科学计算包。 安装scikit-learn有两种方式#xff1a; #xff08;1#xff09;安装… scikit-learn 是一个python实现的免费开源的机器学习算法包从字面意思可知science 代表科学kit代表工具箱直接翻译过来就是用于机器学习的科学计算包。 安装scikit-learn有两种方式 1安装官方发布的包。 2安装第三方开发工具里边已经包含了scikit-learn。
对于2我推荐的是canopy在mac和windows都比较好用。可以不用考虑安装pythonnumpyscipy因为canopy已经自自带了这些。 scikit-learn需要以下包或者工具
Python ( 2.6 or 3.3),NumPy ( 1.6.1),SciPy ( 0.9).
其实往往我们还需要matplotlib这个可以非常方便的画图显示数据可以有matlab一样的效果。
1. Windows下的安装
First you need to install numpy and scipy from their own official installers.
Wheel packages (.whl files) for scikit-learn from PyPI can be installed with the pip utility. Open a console and type the following to install or upgrade scikit-learn to the latest stable release: pip install -U scikit-learnIf there are no binary packages matching your Python version you might to try to install scikit-learn and its dependencies fromChristoph Gohlke Unofficial Windows installers or from a Python distribution instead. 2. Mac下的安装
Scikit-learn and its dependencies are all available as wheel packages for OSX: pip install -U numpy scipy scikit-learn 3. Linux下的安装
linux下没有提供像windows和Mac下那样方便的安装包所以必须手工创建依赖库。
从源码安装需要scikit-learn运行依赖库、python开发头文件c/c编译器。
3.1 Under Debian-based operating systems, which include Ubuntu, if you have Python 2 you can install all these requirements by issuing:
如果是python2.6或者python2.7你可以执行如下的命令 sudo apt-get install build-essential python-dev python-setuptools \python-numpy python-scipy \libatlas-dev libatlas3gf-base 如果是python3.3或者python3.4你可以执行如下的命令 sudo apt-get install build-essential python3-dev python3-setuptools \python3-numpy python3-scipy \libatlas-dev libatlas3gf-base 安装matplotlib sudo apt-get install python-matplotlib 3.2 在centos或者redhat下可以这样安装 sudo yum -y install gcc gcc-c numpy python-devel scipy 3.3. 使用pip安装scikit-learn pip install --user --install-option--prefix -U scikit-learn