<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>1. Installing scikits.learn — scikits.learn v0.6.0 documentation</title> <link rel="stylesheet" href="_static/nature.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '', VERSION: '0.6.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="shortcut icon" href="_static/favicon.ico"/> <link rel="author" title="About these documents" href="about.html" /> <link rel="top" title="scikits.learn v0.6.0 documentation" href="index.html" /> <link rel="up" title="<no title>" href="contents.html" /> <link rel="next" title="2. Getting started: an introduction to machine learning with scikits.learn" href="tutorial.html" /> <link rel="prev" title="<no title>" href="contents.html" /> </head> <body> <div class="header-wrapper"> <div class="header"> <p class="logo"><a href="index.html"> <img src="_static/scikit-learn-logo-small.png" alt="Logo"/> </a> </p><div class="navbar"> <ul> <li><a href="#">Download</a></li> <li><a href="support.html">Support</a></li> <li><a href="user_guide.html">User Guide</a></li> <li><a href="auto_examples/index.html">Examples</a></li> <li><a href="developers/index.html">Development</a></li> </ul> <div class="search_form"> <div id="cse" style="width: 100%;"></div> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('016639176250731907682:tjtqbvtvij0'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.setAutoComplete(true); customSearchControl.draw('cse', options); }, true); </script> </div> </div> <!-- end navbar --></div> </div> <div class="content-wrapper"> <!-- <div id="blue_tile"></div> --> <div class="sphinxsidebar"> <div class="rel"> <a href="contents.html" title="<no title>" accesskey="P">previous</a> | <a href="tutorial.html" title="2. Getting started: an introduction to machine learning with scikits.learn" accesskey="N">next</a> | <a href="genindex.html" title="General Index" accesskey="I">index</a> </div> <h3>Contents</h3> <ul> <li><a class="reference internal" href="#">1. Installing <cite>scikits.learn</cite></a><ul> <li><a class="reference internal" href="#installing-an-official-release">1.1. Installing an official release</a><ul> <li><a class="reference internal" href="#installing-from-source">1.1.1. Installing from source</a><ul> <li><a class="reference internal" href="#easy-install">1.1.1.1. Easy install</a></li> <li><a class="reference internal" href="#from-source-package">1.1.1.2. From source package</a></li> </ul> </li> <li><a class="reference internal" href="#windows-installer">1.1.2. Windows installer</a></li> </ul> </li> <li><a class="reference internal" href="#third-party-distributions-of-scikits-learn">1.2. Third party distributions of scikits.learn</a><ul> <li><a class="reference internal" href="#debian-and-derivatives-ubuntu">1.2.1. Debian and derivatives (Ubuntu)</a></li> <li><a class="reference internal" href="#enthought-python-distribution">1.2.2. Enthought python distribution</a></li> <li><a class="reference internal" href="#macports">1.2.3. Macports</a></li> </ul> </li> <li><a class="reference internal" href="#bleeding-edge">1.3. Bleeding Edge</a></li> <li><a class="reference internal" href="#testing">1.4. Testing</a></li> </ul> </li> </ul> </div> <div class="content"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="installing-scikits-learn"> <h1>1. Installing <cite>scikits.learn</cite><a class="headerlink" href="#installing-scikits-learn" title="Permalink to this headline">¶</a></h1> <p>There are different ways to get scikits.learn installed:</p> <blockquote> <ul class="simple"> <li>Install the version of scikits.learn provided by your <a class="reference internal" href="#install-by-distribution"><em>operating system distribution</em></a> . This is the quickest option for those who have operating systems that distribute scikits.learn.</li> <li><a class="reference internal" href="#install-official-release"><em>Install an official release</em></a>. This is the best approach for users who want a stable version number and aren’t concerned about running a slightly older version of scikits.learn.</li> <li><a class="reference internal" href="#install-bleeding-edge"><em>Install the latest development version</em></a>. This is best for users who want the latest-and-greatest features and aren’t afraid of running brand-new code.</li> </ul> </blockquote> <div class="section" id="installing-an-official-release"> <span id="install-official-release"></span><h2>1.1. Installing an official release<a class="headerlink" href="#installing-an-official-release" title="Permalink to this headline">¶</a></h2> <div class="section" id="installing-from-source"> <h3>1.1.1. Installing from source<a class="headerlink" href="#installing-from-source" title="Permalink to this headline">¶</a></h3> <p>Installing from source requires you to have installed numpy, setuptools, python development headers and a working C++ compiler. Under debian-like systems you can get all this by executing with root privileges:</p> <div class="highlight-python"><pre>sudo apt-get install python-dev python-numpy python-setuptools python-scipy libatlas-dev g++</pre> </div> <div class="section" id="easy-install"> <h4>1.1.1.1. Easy install<a class="headerlink" href="#easy-install" title="Permalink to this headline">¶</a></h4> <p>This is usually the fastest way to install the latest stable release. If you have pip or easy_install, you can install or update with the command:</p> <div class="highlight-python"><pre>pip install -U scikits.learn</pre> </div> <p>or:</p> <div class="highlight-python"><pre>easy_install -U scikits.learn</pre> </div> <p>for easy_install. Note that you might need root privileges to run these commands.</p> </div> <div class="section" id="from-source-package"> <h4>1.1.1.2. From source package<a class="headerlink" href="#from-source-package" title="Permalink to this headline">¶</a></h4> <p>Download the package from <a class="reference external" href="http://sourceforge.net/projects/scikit-learn/files">http://sourceforge.net/projects/scikit-learn/files</a> , unpack the sources and cd into archive.</p> <p>This packages uses distutils, which is the default way of installing python modules. The install command is:</p> <div class="highlight-python"><pre>python setup.py install</pre> </div> </div> </div> <div class="section" id="windows-installer"> <h3>1.1.2. Windows installer<a class="headerlink" href="#windows-installer" title="Permalink to this headline">¶</a></h3> <p>You can download a windows installer from <a class="reference external" href="https://sourceforge.net/projects/scikit-learn/files/">downloads</a> in the project’s web page. Note that must also have installed the packages numpy and setuptools.</p> <p>This package is also expected to work with python(x,y) as of 2.6.5.5.</p> </div> </div> <div class="section" id="third-party-distributions-of-scikits-learn"> <span id="install-by-distribution"></span><h2>1.2. Third party distributions of scikits.learn<a class="headerlink" href="#third-party-distributions-of-scikits-learn" title="Permalink to this headline">¶</a></h2> <p>Some third-party distributions are now providing versions of scikits.learn integrated with their package-management systems.</p> <p>These can make installation and upgrading much easier for users since the integration includes the ability to automatically install dependencies (numpy, scipy) that scikits.learn requires.</p> <p>The following is a list of linux distributions that provide their own version of scikits.learn:</p> <div class="section" id="debian-and-derivatives-ubuntu"> <h3>1.2.1. Debian and derivatives (Ubuntu)<a class="headerlink" href="#debian-and-derivatives-ubuntu" title="Permalink to this headline">¶</a></h3> <p>The Debian package is named python-scikits-learn and can be install using the following commands with root privileges:</p> <div class="highlight-python"><pre>apt-get install python-scikits-learn</pre> </div> </div> <div class="section" id="enthought-python-distribution"> <h3>1.2.2. Enthought python distribution<a class="headerlink" href="#enthought-python-distribution" title="Permalink to this headline">¶</a></h3> <p>The <a class="reference external" href="http://www.enthought.com/products/epd.php">Enthought Python Distribution</a> already ships the latest version.</p> </div> <div class="section" id="macports"> <h3>1.2.3. Macports<a class="headerlink" href="#macports" title="Permalink to this headline">¶</a></h3> <p>The macport’s package is named py26-scikits-learn and can be installed by typing the following command:</p> <div class="highlight-python"><pre>sudo port install py26-scikits-learn</pre> </div> </div> </div> <div class="section" id="bleeding-edge"> <span id="install-bleeding-edge"></span><h2>1.3. Bleeding Edge<a class="headerlink" href="#bleeding-edge" title="Permalink to this headline">¶</a></h2> <p>See section <a class="reference internal" href="developers/index.html#git-repo"><em>Retrieving the latest code</em></a> on how to get the development version.</p> </div> <div class="section" id="testing"> <span id="id2"></span><h2>1.4. Testing<a class="headerlink" href="#testing" title="Permalink to this headline">¶</a></h2> <p>Testing requires having the <a class="reference external" href="http://somethingaboutorange.com/mrl/projects/nose/">nose</a> library. After installation, the package can be tested by executing from outside the source directory:</p> <div class="highlight-python"><pre>python -c "import scikits.learn as skl; skl.test()"</pre> </div> <p>This should give you a lot of output (and some warnings) but eventually should finish with the a text similar to:</p> <div class="highlight-python"><pre>Ran 601 tests in 27.920s OK (SKIP=2)</pre> </div> <p>otherwise please consider submitting a bug in the <a class="reference internal" href="support.html#bug-tracker"><em>Bug tracker</em></a> or to the <a class="reference internal" href="support.html#mailing-lists"><em>Mailing List</em></a>.</p> <p>scikits.learn can also be tested without having the package installed. For this you must compile the sources inplace from the source directory:</p> <div class="highlight-python"><pre>python setup.py build_ext --inplace</pre> </div> <p>Test can now be run using nosetest:</p> <div class="highlight-python"><pre>nosetests scikits/learn/</pre> </div> <p>If you are running the deveopment version, this is automated in the commands <cite>make in</cite> and <cite>make test</cite>.</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">Because nosetest does not play well with multiprocessing on windows, this last approach is not recommended on such system.</p> </div> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> </div> <div class="footer"> <p style="text-align: center">This documentation is relative to scikits.learn version 0.6.0<p> © 2010, scikits.learn developers (BSD Lincense). Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5. Design by <a href="http://webylimonada.com">Web y Limonada</a>. </div> </body> </html>