Skip to content

Commit b85d32b

Browse files
committed
Pushing the docs for revision for branch: , commit
1 parent d67799d commit b85d32b

File tree

2,611 files changed

+27266
-48877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,611 files changed

+27266
-48877
lines changed

dev/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 7428c9dd0e2fe5a32dd39c1f52ee5c08
3+
config: 0d839c7aff39e2bc97dda02409424dd9
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4+
5+
6+
<html xmlns="http://www.w3.org/1999/xhtml">
7+
<head>
8+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9+
10+
11+
<title>Machine Learning Cheat Sheet (for scikit-learn) &mdash; scikit-learn 0.18.dev0 documentation</title>
12+
<!-- htmltitle is before nature.css - we use this hack to load bootstrap first -->
13+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
14+
<link rel="stylesheet" href="../../../../_static/css/bootstrap.min.css" media="screen" />
15+
<link rel="stylesheet" href="../../../../_static/css/bootstrap-responsive.css"/>
16+
17+
18+
<link rel="stylesheet" href="../../../../_static/nature.css" type="text/css" />
19+
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
20+
<link rel="stylesheet" href="../../../../_static/gallery.css" type="text/css" />
21+
22+
<script type="text/javascript">
23+
var DOCUMENTATION_OPTIONS = {
24+
URL_ROOT: '../../../../',
25+
VERSION: '0.18.dev0',
26+
COLLAPSE_INDEX: false,
27+
FILE_SUFFIX: '.html',
28+
HAS_SOURCE: true
29+
};
30+
</script>
31+
<script type="text/javascript" src="../../../../_static/jquery.js"></script>
32+
<script type="text/javascript" src="../../../../_static/underscore.js"></script>
33+
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
34+
<script type="text/javascript" src="../../../../_static/js/copybutton.js"></script>
35+
<link rel="shortcut icon" href="../../../../_static/favicon.ico"/>
36+
<link rel="author" title="About these documents" href="../../../../about.html" />
37+
<link rel="top" title="scikit-learn 0.18.dev0 documentation" href="../../../../index.html" />
38+
39+
40+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
41+
<script src="../../../../_static/js/bootstrap.min.js" type="text/javascript"></script>
42+
<link rel="canonical" href="http://scikit-learn.org/stable/_build/html/stable/_static/ML_MAPS_README.html" />
43+
44+
<script type="text/javascript">
45+
$("div.buttonNext, div.buttonPrevious").hover(
46+
function () {
47+
$(this).css('background-color', '#FF9C34');
48+
},
49+
function () {
50+
$(this).css('background-color', '#A7D6E2');
51+
}
52+
);
53+
</script>
54+
55+
</head>
56+
<body role="document">
57+
58+
<div class="header-wrapper">
59+
<div class="header">
60+
<p class="logo"><a href="../../../../index.html">
61+
<img src="../../../../_static/scikit-learn-logo-small.png" alt="Logo"/>
62+
</a>
63+
</p><div class="navbar">
64+
<ul>
65+
<li><a href="../../../../index.html">Home</a></li>
66+
<li><a href="../../../../install.html">Installation</a></li>
67+
<li class="btn-li"><div class="btn-group">
68+
<a href="../../../../documentation.html">Documentation</a>
69+
<a class="btn dropdown-toggle" data-toggle="dropdown">
70+
<span class="caret"></span>
71+
</a>
72+
<ul class="dropdown-menu">
73+
<li class="link-title">Scikit-learn 0.17 (development)</li>
74+
<li><a href="../../../../tutorial/index.html">Tutorials</a></li>
75+
<li><a href="../../../../user_guide.html">User guide</a></li>
76+
<li><a href="../../../../modules/classes.html">API</a></li>
77+
<li><a href="../../../../faq.html">FAQ</a></li>
78+
<li><a href="../../../../developers.html">Contributing</a></li>
79+
<li class="divider"></li>
80+
<li><a href="http://scikit-learn.org/stable/documentation.html">Scikit-learn 0.16.1 (stable)</a></li>
81+
<li><a href="http://scikit-learn.org/0.15/documentation.html">Scikit-learn 0.15</a></li>
82+
<li><a href="../../../../_downloads/user_guide.pdf">PDF documentation</a></li>
83+
</ul>
84+
</div>
85+
</li>
86+
<li><a href="../../../../auto_examples/index.html">Examples</a></li>
87+
</ul>
88+
89+
<div class="search_form">
90+
<div id="cse" style="width: 100%;"></div>
91+
</div>
92+
</div> <!-- end navbar --></div>
93+
</div>
94+
95+
96+
<!-- Github "fork me" ribbon -->
97+
<a href="https://github.com/scikit-learn/scikit-learn">
98+
<img class="fork-me"
99+
style="position: absolute; top: 0; right: 0; border: 0;"
100+
src="../../../../_static/img/forkme.png"
101+
alt="Fork me on GitHub" />
102+
</a>
103+
104+
<div class="content-wrapper">
105+
<div class="sphinxsidebar">
106+
<div class="sphinxsidebarwrapper">
107+
<p class="doc-version">This documentation is for scikit-learn <strong>version 0.18.dev0</strong> &mdash; <a href="http://scikit-learn.org/stable/support.html#documentation-resources">Other versions</a></p>
108+
<p class="citing">If you use the software, please consider <a href="../../../../about.html#citing-scikit-learn">citing scikit-learn</a>.</p>
109+
<ul>
110+
<li><a class="reference internal" href="#">Machine Learning Cheat Sheet (for scikit-learn)</a><ul>
111+
<li><a class="reference internal" href="#editing-the-layout-of-the-map-and-it-s-paths">1. Editing the layout of the map and it&#8217;s paths.</a></li>
112+
<li><a class="reference internal" href="#accessing-the-paths-of-the-svg-file-and-exporting-them">2. Accessing the paths of the SVG file and exporting them.</a></li>
113+
<li><a class="reference internal" href="#export-paths-as-svg-files">3. Export paths as SVG files</a></li>
114+
<li><a class="reference internal" href="#edit-the-svg-file">4. Edit the SVG file</a></li>
115+
<li><a class="reference internal" href="#from-svg-to-html-map">5. From SVG to HTML map</a></li>
116+
<li><a class="reference internal" href="#add-the-new-map-to-the-main-html-file">6. Add the new map to the main html file</a></li>
117+
</ul>
118+
</li>
119+
</ul>
120+
121+
</div>
122+
</div>
123+
124+
<input type="checkbox" id="nav-trigger" class="nav-trigger" checked />
125+
<label for="nav-trigger"></label>
126+
127+
128+
129+
130+
<div class="content">
131+
132+
<div class="documentwrapper">
133+
<div class="bodywrapper">
134+
<div class="body" role="main">
135+
136+
<div class="section" id="machine-learning-cheat-sheet-for-scikit-learn">
137+
<h1>Machine Learning Cheat Sheet (for scikit-learn)<a class="headerlink" href="#machine-learning-cheat-sheet-for-scikit-learn" title="Permalink to this headline"></a></h1>
138+
<p>This document is intended to explain how to edit
139+
the machine learning cheat sheet, originally created
140+
by Andreas Mueller:</p>
141+
<p>(<a class="reference external" href="http://peekaboo-vision.blogspot.de/2013/01/machine-learning-cheat-sheet-for-scikit.html">http://peekaboo-vision.blogspot.de/2013/01/machine-learning-cheat-sheet-for-scikit.html</a>)</p>
142+
<p>The image is made interactive using an imagemap, and uses the jQuery Map Hilight plugin module
143+
by David Lynch (<a class="reference external" href="http://davidlynch.org/projects/maphilight/docs/">http://davidlynch.org/projects/maphilight/docs/</a>) to highlight
144+
the different items on the image upon mouseover.</p>
145+
<p>Modifying the map on the docs is currently a little bit tedious,
146+
so I&#8217;ll try to make it as simple as possible.</p>
147+
<div class="section" id="editing-the-layout-of-the-map-and-it-s-paths">
148+
<h2>1. Editing the layout of the map and it&#8217;s paths.<a class="headerlink" href="#editing-the-layout-of-the-map-and-it-s-paths" title="Permalink to this headline"></a></h2>
149+
<p>Use a Graphics editor like Inkscape Vector Graphics Editor
150+
to open the ml_map.svg file, in this folder. From there
151+
you can move objects around, ect. as you need.</p>
152+
<p>Save when done, and make sure to export a .PNG file
153+
to replace the old-outdated ml_map.png, as that file
154+
is used as a background image.</p>
155+
</div>
156+
<div class="section" id="accessing-the-paths-of-the-svg-file-and-exporting-them">
157+
<h2>2. Accessing the paths of the SVG file and exporting them.<a class="headerlink" href="#accessing-the-paths-of-the-svg-file-and-exporting-them" title="Permalink to this headline"></a></h2>
158+
<p>Use an image manipulation package like GIMP Image Editor to open
159+
the ml_map.svg file, in this folder. With GIMP, make sure
160+
to select &#8216;Import paths&#8217;.</p>
161+
<p>Once the image has been opened, you can see all imported paths on the paths tab.
162+
You can edit these or create new paths. In GIMP, right-clicking one of the
163+
paths and choosing: Path Tool will allow you to see the paths on
164+
the image. The paths will be exported later and will be used to
165+
make the click able regions on our image map.</p>
166+
</div>
167+
<div class="section" id="export-paths-as-svg-files">
168+
<h2>3. Export paths as SVG files<a class="headerlink" href="#export-paths-as-svg-files" title="Permalink to this headline"></a></h2>
169+
<p>After you&#8217;ve edited a path or created a new one, right click it on
170+
the paths menu and choose &#8216;Export Path..&#8217;. This way we extract just
171+
that path on its own as &#8216;new_area.svg&#8217; for example.</p>
172+
</div>
173+
<div class="section" id="edit-the-svg-file">
174+
<h2>4. Edit the SVG file<a class="headerlink" href="#edit-the-svg-file" title="Permalink to this headline"></a></h2>
175+
<p>Using a script made by David Lynch, we will convert the svg files into
176+
html maps. To do this, open the svg file in question in any text editor.
177+
Make sure that the &#8216;width&#8217; and &#8216;height&#8217; are not in &#8216;in&#8217; or &#8216;px&#8217;, i.e
178+
&#8220;100&#8221; is OK, but &#8220;100px&#8221; or &#8220;1.25in&#8221; are not.</p>
179+
<p>Then wrap the &lt;path&gt; tags in &lt;g&gt; and &lt;/g&gt; tags.
180+
Then the file is ready for the script.</p>
181+
</div>
182+
<div class="section" id="from-svg-to-html-map">
183+
<h2>5. From SVG to HTML map<a class="headerlink" href="#from-svg-to-html-map" title="Permalink to this headline"></a></h2>
184+
<p>Use the provided svg2imagemap.py script on your edited svg file:</p>
185+
<p>$ python svg2imagemap.py new_area.svg</p>
186+
<p>where new_area.svg is our file.</p>
187+
</div>
188+
<div class="section" id="add-the-new-map-to-the-main-html-file">
189+
<h2>6. Add the new map to the main html file<a class="headerlink" href="#add-the-new-map-to-the-main-html-file" title="Permalink to this headline"></a></h2>
190+
<p>Copy the code from the newly created &#8216;new_area.html&#8217;
191+
file. Open the ml_map.html file.</p>
192+
<p>Add the &lt;area href=....... &gt;&lt;/area&gt; that you copied
193+
after the last &lt;/area&gt; tag in the ml_map.html file.</p>
194+
<p>Add the link address to &#8216;href&#8217; and a tooltip to
195+
&#8216;title&#8217; within your &lt;area ...&gt; tag.</p>
196+
<p>If you wish to add the green and blue hover effect
197+
to the area, add
198+
data-maphilight=&#8217;{&#8220;strokeColor&#8221;:&#8221;0000ff&#8221;,&#8221;strokeWidth&#8221;:5,&#8221;fillColor&#8221;:&#8221;66FF66&#8221;,&#8221;fillOpacity&#8221;:0.4}&#8217;</p>
199+
<p>to your area tag, as done in the other &lt;area..&gt; tags above.</p>
200+
<p>Save the file, and you&#8217;re done.</p>
201+
<hr class="docutils" />
202+
<p>I&#8217;ll take some time to make some scripts to automate this process
203+
a bit more at some point, as it is not difficult to do,
204+
but tedious.</p>
205+
<p>-Jaques Grobler</p>
206+
</div>
207+
</div>
208+
209+
210+
</div>
211+
</div>
212+
</div>
213+
<div class="clearer"></div>
214+
</div>
215+
</div>
216+
217+
<div class="footer">
218+
&copy; 2010 - 2014, scikit-learn developers (BSD License).
219+
<a href="../../../../_sources/_build/html/stable/_static/ML_MAPS_README.txt" rel="nofollow">Show this page source</a>
220+
</div>
221+
<div class="rel rellarge">
222+
223+
224+
</div>
225+
226+
227+
<script type="text/javascript">
228+
var _gaq = _gaq || [];
229+
_gaq.push(['_setAccount', 'UA-22606712-2']);
230+
_gaq.push(['_trackPageview']);
231+
232+
(function() {
233+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
234+
ga.src = ('https:' == document.___location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
235+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
236+
})();
237+
</script>
238+
239+
240+
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
241+
<script type="text/javascript"> google.load('search', '1',
242+
{language : 'en'}); google.setOnLoadCallback(function() {
243+
var customSearchControl = new
244+
google.search.CustomSearchControl('016639176250731907682:tjtqbvtvij0');
245+
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
246+
var options = new google.search.DrawOptions();
247+
options.setAutoComplete(true);
248+
customSearchControl.draw('cse', options); }, true);
249+
</script>
250+
</body>
251+
</html>

dev/_downloads/gp_diabetes_dataset.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
4+
"""
5+
========================================================================
6+
Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset
7+
========================================================================
8+
9+
In this example, we fit a Gaussian Process model onto the diabetes
10+
dataset.
11+
12+
We determine the correlation parameters with maximum likelihood
13+
estimation (MLE). We use an anisotropic squared exponential
14+
correlation model with a constant regression model. We also use a
15+
nugget of 1e-2 to account for the (strong) noise in the targets.
16+
17+
We compute a cross-validation estimate of the coefficient of
18+
determination (R2) without reperforming MLE, using the set of correlation
19+
parameters found on the whole dataset.
20+
"""
21+
print(__doc__)
22+
23+
# Author: Vincent Dubourg <[email protected]>
24+
# Licence: BSD 3 clause
25+
26+
from sklearn import datasets
27+
from sklearn.gaussian_process import GaussianProcess
28+
from sklearn.cross_validation import cross_val_score, KFold
29+
30+
# Load the dataset from scikit's data sets
31+
diabetes = datasets.load_diabetes()
32+
X, y = diabetes.data, diabetes.target
33+
34+
# Instanciate a GP model
35+
gp = GaussianProcess(regr='constant', corr='absolute_exponential',
36+
theta0=[1e-4] * 10, thetaL=[1e-12] * 10,
37+
thetaU=[1e-2] * 10, nugget=1e-2, optimizer='Welch')
38+
39+
# Fit the GP model to the data performing maximum likelihood estimation
40+
gp.fit(X, y)
41+
42+
# Deactivate maximum likelihood estimation for the cross-validation loop
43+
gp.theta0 = gp.theta_ # Given correlation parameter = MLE
44+
gp.thetaL, gp.thetaU = None, None # None bounds deactivate MLE
45+
46+
# Perform a cross-validation estimate of the coefficient of determination using
47+
# the cross_validation module using all CPUs available on the machine
48+
K = 20 # folds
49+
R2 = cross_val_score(gp, X, y=y, cv=KFold(y.size, K), n_jobs=1).mean()
50+
print("The %d-Folds estimate of the coefficient of determination is R2 = %s"
51+
% (K, R2))

dev/_downloads/plot_approximate_nearest_neighbors_hyperparameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
plt.errorbar(n_candidates_values, accuracies_c[i, :],
111111
stds_accuracies[i, :], c=colors[i])
112112

113-
plt.legend(loc='upper left', prop=dict(size='small'))
113+
plt.legend(loc='upper left', fontsize='small')
114114
plt.ylim([0, 1.2])
115115
plt.xlim(min(n_candidates_values), max(n_candidates_values))
116116
plt.ylabel("Accuracy")

dev/_downloads/plot_approximate_nearest_neighbors_scalability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
fmt='o-', c='r', label='LSHForest')
127127
plt.plot(n_samples_values, average_times_exact, c='b',
128128
label="NearestNeighbors(algorithm='brute', metric='cosine')")
129-
plt.legend(loc='upper left', prop=dict(size='small'))
129+
plt.legend(loc='upper left', fontsize='small')
130130
plt.ylim(0, None)
131131
plt.ylabel("Average query time in seconds")
132132
plt.xlabel("n_samples")

dev/_downloads/plot_classification_probability.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Plot the classification probability for different classifiers. We use a 3
77
class dataset, and we classify it with a Support Vector classifier, L1
88
and L2 penalized logistic regression with either a One-Vs-Rest or multinomial
9-
setting, and Gaussian process classification.
9+
setting.
1010
1111
The logistic regression is not a multiclass classifier out of the box. As
1212
a result it can identify only the first class.
@@ -21,8 +21,6 @@ class dataset, and we classify it with a Support Vector classifier, L1
2121

2222
from sklearn.linear_model import LogisticRegression
2323
from sklearn.svm import SVC
24-
from sklearn.gaussian_process import GaussianProcessClassifier
25-
from sklearn.gaussian_process.kernels import RBF
2624
from sklearn import datasets
2725

2826
iris = datasets.load_iris()
@@ -32,7 +30,6 @@ class dataset, and we classify it with a Support Vector classifier, L1
3230
n_features = X.shape[1]
3331

3432
C = 1.0
35-
kernel = 1.0 * RBF([1.0, 1.0]) # for GPC
3633

3734
# Create different classifiers. The logistic regression cannot do
3835
# multiclass out of the box.
@@ -41,9 +38,8 @@ class dataset, and we classify it with a Support Vector classifier, L1
4138
'Linear SVC': SVC(kernel='linear', C=C, probability=True,
4239
random_state=0),
4340
'L2 logistic (Multinomial)': LogisticRegression(
44-
C=C, solver='lbfgs', multi_class='multinomial'),
45-
'GPC': GaussianProcessClassifier(kernel)
46-
}
41+
C=C, solver='lbfgs', multi_class='multinomial'
42+
)}
4743

4844
n_classifiers = len(classifiers)
4945

0 commit comments

Comments
 (0)