Scikit-learn is a comprehensive toolbox for machine learning in Python. This guide shows how to install scikit-learn on top of the Canopy Python distribution in a Windows machine.
Download and run the Canopy express python installer for your windows distribution. Adding the installation to the path environment variable deals with previous installations and other conflicts. The following PowerShell (PS) command does exactly that:
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Users\YOURNAME\AppData\Local\Enthought\Canopy32\User;C:\Users\YOURNAME\AppData\Local\Enthought\Canopy32\User\Scripts", "User")
Open a new PS terminal and type
pythonto start an interactive Canopy python shell. Use the
exit()to return to PowerShell.
The Python Packaging Index (PIP) downloads and manages Python packages conveniently. The recommended way to install PIP in Windows is executing the linked script:
At this point, you would like to use Canopy's graphical package manager to install libraries such as numpy, scipy or matplotlib. However, Scikit-learn must be installed via command line using PIP:
pip install -U scikit-learn
Within a Python shell, type
import sklearn; to confirm that the library is ready to be used. A more complete test is described in their official website.
In coming posts, I'll provide examples and a small project using scikit-learn.