forked from jaquesgrobler/Online-Scikit-Learn-stat-tut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.html
388 lines (358 loc) · 18.4 KB
/
install.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<!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 scikit-learn — scikit-learn 0.11-git 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.11-git',
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="scikit-learn 0.11-git documentation" href="index.html" />
<link rel="up" title="<no title>" href="user_guide.html" />
<link rel="next" title="2. Tutorials: From the bottom up with scikit-learn" href="tutorial/index.html" />
<link rel="prev" title="<no title>" href="user_guide.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22606712-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</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="modules/classes.html">Reference</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 class="sphinxsidebar">
<div class="rel">
<!-- rellinks[1:] is an ugly hack to avoid link to module
index -->
<div class="rellink">
<a href="user_guide.html" title="<no title>"
accesskey="P">Previous
<br>
<span class="smallrellink">
<no title>
</span>
<span class="hiddenrellink">
<no title>
</span>
</a>
</div>
<div class="spacer">
</div>
<div class="rellink">
<a href="tutorial/index.html" title="2. Tutorials: From the bottom up with scikit-learn"
accesskey="N">Next
<br>
<span class="smallrellink">
2. Tutorials: Fr...
</span>
<span class="hiddenrellink">
2. Tutorials: From the bottom up with scikit-learn
</span>
</a>
</div>
<!-- Ad a link to the 'up' page -->
<div class="spacer">
</div>
<div class="rellink">
<a href="user_guide.html" title="<no title>" >
Up
<br>
<span class="smallrellink">
<no title>
</span>
</a>
</div>
</div>
<p style="text-align: center">This documentation is
for scikit-learn <strong>version 0.11-git</strong>
— <a href="http://scikit-learn.org/stable/support.html#documentation-resources">Other versions</a></p>
<h3>Citing</h3>
<p>If you use the software, please consider
<a href="about.html#citing-scikit-learn">citing scikit-learn</a>.</p>
<h3>This page</h3>
<ul>
<li><a class="reference internal" href="#">1. Installing <cite>scikit-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>
<li><a class="reference internal" href="#building-on-windows">1.1.3. Building on windows</a></li>
</ul>
</li>
<li><a class="reference internal" href="#third-party-distributions-of-scikit-learn">1.2. Third party distributions of scikit-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="#python-x-y">1.2.2. Python(x, y)</a></li>
<li><a class="reference internal" href="#enthought-python-distribution">1.2.3. Enthought Python distribution</a></li>
<li><a class="reference internal" href="#macports">1.2.4. Macports</a></li>
<li><a class="reference internal" href="#netbsd">1.2.5. NetBSD</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-scikit-learn">
<h1>1. Installing <cite>scikit-learn</cite><a class="headerlink" href="#installing-scikit-learn" title="Permalink to this headline">¶</a></h1>
<p>There are different ways to get scikit-learn installed:</p>
<blockquote>
<div><ul class="simple">
<li>Install the version of scikit-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 scikit-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
scikit-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>
</div></blockquote>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you wish to contribute to the project, it’s recommended you
<a class="reference internal" href="#install-bleeding-edge"><em>install the latest development version</em></a>.</p>
</div>
<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 python (>= 2.6), numpy
(>= 1.3), scipy (>= 0.7), setuptools, python development headers and a working
C++ compiler. Under Debian-based 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-numpy-dev python-setuptools python-numpy-dev python-scipy libatlas-dev g++</pre>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>In Order to build the documentation and run the example code contains in
this documentation you will need matplotlib:</p>
<div class="last highlight-python"><pre>sudo apt-get install python-matplotlib</pre>
</div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">On Ubuntu LTS (10.04) the package <cite>libatlas-dev</cite> is called <cite>libatlas-headers</cite></p>
</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 scikit-learn</pre>
</div>
<p>or:</p>
<div class="highlight-python"><pre>easy_install -U scikit-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://pypi.python.org/pypi/scikit-learn/">http://pypi.python.org/pypi/scikit-learn/</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 class="topic">
<p class="topic-title first"><strong>Installing on Windows 64bit</strong></p>
<p>To install a 64bit version of the scikit, you can download the
binaries from <a class="reference external" href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn">http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn</a>
Note that this will require a compatible version of numpy, scipy and
matplotlib. The easiest option is to also download them from the same
URL.</p>
</div>
</div>
<div class="section" id="building-on-windows">
<h3>1.1.3. Building on windows<a class="headerlink" href="#building-on-windows" title="Permalink to this headline">¶</a></h3>
<p>To build scikit-learn on windows you will need a C/C++ compiler in
addition to numpy, scipy and setuptools. At least
<a class="reference external" href="http://www.mingw.org">MinGW</a> (a port of GCC to Windows OS) and the
Microsoft Visual C++ 2008 should work out of the box. To force the use
of a particular compiler, write a file named <tt class="docutils literal"><span class="pre">setup.cfg</span></tt> in the
source directory with the content:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span><span class="n">build_ext</span><span class="p">]</span>
<span class="n">compiler</span><span class="o">=</span><span class="n">my_compiler</span>
<span class="p">[</span><span class="n">build</span><span class="p">]</span>
<span class="n">compiler</span><span class="o">=</span><span class="n">my_compiler</span>
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">my_compiler</span></tt> should be one of <tt class="docutils literal"><span class="pre">mingw32</span></tt> or <tt class="docutils literal"><span class="pre">msvc</span></tt>.</p>
<p>When the appropriate compiler has been set, and assuming Python is
in your PATH (see
<a class="reference external" href="http://docs.python.org/faq/windows.html">Python FAQ for windows</a>
for more details), installation is done by
executing the command:</p>
<div class="highlight-python"><pre>python setup.py install</pre>
</div>
<p>To build a precompiled package like the ones distributed at
<a class="reference external" href="https://sourceforge.net/projects/scikit-learn/files/">the downloads section</a>,
the command to execute is:</p>
<div class="highlight-python"><pre>python setup.py bdist_wininst -b doc/logos/scikit-learn-logo.bmp</pre>
</div>
<p>This will create an installable binary under directory <tt class="docutils literal"><span class="pre">dist/</span></tt>.</p>
</div>
</div>
<div class="section" id="third-party-distributions-of-scikit-learn">
<span id="install-by-distribution"></span><h2>1.2. Third party distributions of scikit-learn<a class="headerlink" href="#third-party-distributions-of-scikit-learn" title="Permalink to this headline">¶</a></h2>
<p>Some third-party distributions are now providing versions of
scikit-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 scikit-learn requires.</p>
<p>The following is a list of Linux distributions that provide their own
version of scikit-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-sklearn (formerly
python-scikits-learn) and can be installed using the following
commands with root privileges:</p>
<div class="highlight-python"><pre>apt-get install python-sklearn</pre>
</div>
<p>Additionally, backport builds of the most recent release of
scikit-learn for existing releases of Debian and Ubuntu are available
from <a class="reference external" href="http://neuro.debian.net/pkgs/python-scikits-learn.html">NeuroDebian repository</a> .</p>
</div>
<div class="section" id="python-x-y">
<h3>1.2.2. Python(x, y)<a class="headerlink" href="#python-x-y" title="Permalink to this headline">¶</a></h3>
<p>The <a class="reference external" href="http://pythonxy.com">Python(x, y)</a> distributes scikit-learn as an additional plugin, which can
be found in the <a class="reference external" href="http://code.google.com/p/pythonxy/wiki/AdditionalPlugins">Additional plugins</a>
page.</p>
</div>
<div class="section" id="enthought-python-distribution">
<h3>1.2.3. 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 a recent
version.</p>
</div>
<div class="section" id="macports">
<h3>1.2.4. Macports<a class="headerlink" href="#macports" title="Permalink to this headline">¶</a></h3>
<p>The macport’s package is named py26-sklearn 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 class="section" id="netbsd">
<h3>1.2.5. NetBSD<a class="headerlink" href="#netbsd" title="Permalink to this headline">¶</a></h3>
<p>scikit-learn is available via <a class="reference external" href="http://pkgsrc-wip.sourceforge.net/">pkgsrc-wip</a>:</p>
<blockquote>
<div><a class="reference external" href="http://pkgsrc.se/wip/py-scikit_learn">http://pkgsrc.se/wip/py-scikit_learn</a></div></blockquote>
</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="id3"></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 <em>from outside</em> the
source directory:</p>
<div class="highlight-python"><pre>python -c "import sklearn; sklearn.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 posting an issue into the <a class="reference external" href="https://github.com/scikit-learn/scikit-learn/issues">bug tracker</a> or to the
<a class="reference internal" href="support.html#mailing-lists"><em>Mailing List</em></a>.</p>
<p>scikit-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 sklearn/</pre>
</div>
<p>If you are running the development 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">
© 2010–2011, scikit-learn developers (BSD License).
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. Design by <a href="http://webylimonada.com">Web y Limonada</a>.
<span style="padding-left: 5ex;">
<a href="_sources/install.txt"
rel="nofollow">Show this page source</a>
</span>
</div>
</body>
</html>