Scikit-learn is a free and open-source machine learning algorithm package implemented by python. From the literal meaning, science represents science, and Kit represents toolbox, directly translated into a scientific computing package for machine learning.
There are two ways to install scikit-learn:
(1) install the officially released package.
(2) install a third-party development tool that contains scikit-learn.
For (2), I recommend canopy, which is easy to use in both Mac and windows. You don't need to consider installing python, numpy, and scipy, because canopy already comes with these.
Scikit-learn requires the following packages or tools:
- Python (>=2.6 or >=3.3 ),
- Numpy (> = 1.6.1 ),
- Scipy (>=0.9 ).
In fact, we often need matplotlib, which can be very convenient to display the data, and can have the same effect as MATLAB.
1. Installation in 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-learn
If 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 fromPython DistributionInstead.
2. Installation on Mac
Scikit-learn and its dependencies are all available as wheel packages for OSX:
pip install -U numpy scipy scikit-learn
3. Installation in Linux
Linux does not provide installation packages that are as convenient as Windows and Mac. Therefore, you must manually create a dependent library.
To install the source code, you must run the scikit-learn dependency library, Python development header file, and C/C ++ compiler.
3.1 Under Debian-based operating systems, which include Ubuntu, if you have Python 2 You can install all these requirements by issuing:
If it is python2.6 or python2.7, You can execute the following command:
sudo apt-get install build-essential python-dev python-setuptools python-numpy python-scipy libatlas-dev libatlas3gf-base
If it is python3.3 or python3.4, You can execute the following command:
sudo apt-get install build-essential python3-dev python3-setuptools python3-numpy python3-scipy libatlas-dev libatlas3gf-base
Install matplotlib
sudo apt-get install python-matplotlib
3.2 you can install centos or redhad as follows:
sudo yum -y install gcc gcc-c++ numpy python-devel scipy
3.3. Use Pip to install scikit-learn
pip install --user --install-option="--prefix=" -U scikit-learn
Installation of the Machine Learning Algorithm Library scikit-learn