Installation of scikit-learn

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:

  • Python 2.6.x or higher
  • NumPy 1.6.1 or higher
  • SciPy 0.9 or higher

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.

Installing via Anaconda

You can install scikit-learn on Anaconda by running the conda Python package manager:

conda install scikit-learn

Installing on Unix (Linux/Mac OS X)

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

Installing on Windows

To install on Windows, you can open a console and run the following:

pip install –U scikit-learn

Note

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.34.197