As was mentioned in Chapter 2, Installation of pandas and the Supporting Software, the easiest way to install pandas and its accompanying libraries is to use a third-party distribution such as Anaconda and be done with it. Installing scikit-learn
should be no different. I will briefly highlight the steps for installation on various platforms and third-party distributions starting with Anaconda. The scikit-learn
library requires the following libraries:
Assuming that you have already installed pandas as described in Chapter 2, Installation of pandas and the Supporting Software, these dependencies should already be in place.
You can install scikit-learn
on Anaconda by running the conda Python package manager:
conda install scikit-learn
For Unix, it is best to install from the source (C compiler is required). Assuming that pandas and NumPy are already installed and the required dependent libraries are already in place, you can install scikit-learn
via Git by running the following commands:
git clone https://github.com/scikit-learn/scikit-learn.git cd scikitlearn python setup.py install
The pandas can also be installed on Unix by using pip
from PyPi
:
pip install pandas
To install on Windows, you can open a console and run the following:
pip install –U scikit-learn
For more in-depth information on installation, you can take a look at the official scikit-learn
docs at: http://scikit-learn.org/stable/install.html.
You can also take a look at the README file for the scikit-learn
Git repository at: https://github.com/scikit-learn/scikit-learn/blob/master/README.rst.