Skip to content

Commit 1bbbb1f

Browse files
committed
Upgrade the documentation to 0.17.1
1 parent 5c66530 commit 1bbbb1f

File tree

2,481 files changed

+37795
-25411
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,481 files changed

+37795
-25411
lines changed

0.17/.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: 07adb35262cb49a1888499e43bdecceb
3+
config: b302606df6a16951f69a742171a74860
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.17.1 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.17.1',
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.17.1 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 (stable)</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/contributing.html">Contributing</a></li>
79+
<li class="divider"></li>
80+
<li><a href="http://scikit-learn.org/dev/documentation.html">Scikit-learn 0.18 (development)</a></li>
81+
<li><a href="http://scikit-learn.org/0.16/documentation.html">Scikit-learn 0.16</a></li>
82+
<li><a href="../../../../_downloads/scikit-learn-docs.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.17.1</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>

0.17/_downloads/plot_lena_compress.py renamed to 0.17/_downloads/plot_face_compress.py

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
Vector Quantization Example
77
=========================================================
88
9-
The classic image processing example, Lena, an 8-bit grayscale
10-
bit-depth, 512 x 512 sized image, is used here to illustrate
11-
how `k`-means is used for vector quantization.
9+
Face, a 1024 x 768 size image of a raccoon face,
10+
is used here to illustrate how `k`-means is
11+
used for vector quantization.
1212
1313
"""
1414
print(__doc__)
@@ -23,45 +23,52 @@
2323
import matplotlib.pyplot as plt
2424

2525
from sklearn import cluster
26+
from sklearn.utils.testing import SkipTest
27+
from sklearn.utils.fixes import sp_version
2628

27-
n_clusters = 5
28-
np.random.seed(0)
29+
if sp_version < (0, 12):
30+
raise SkipTest("Skipping because SciPy version earlier than 0.12.0 and "
31+
"thus does not include the scipy.misc.face() image.")
2932

3033
try:
31-
lena = sp.lena()
34+
face = sp.face(gray=True)
3235
except AttributeError:
33-
# Newer versions of scipy have lena in misc
36+
# Newer versions of scipy have face in misc
3437
from scipy import misc
35-
lena = misc.lena()
36-
X = lena.reshape((-1, 1)) # We need an (n_sample, n_feature) array
38+
face = misc.face(gray=True)
39+
40+
n_clusters = 5
41+
np.random.seed(0)
42+
43+
X = face.reshape((-1, 1)) # We need an (n_sample, n_feature) array
3744
k_means = cluster.KMeans(n_clusters=n_clusters, n_init=4)
3845
k_means.fit(X)
3946
values = k_means.cluster_centers_.squeeze()
4047
labels = k_means.labels_
4148

4249
# create an array from labels and values
43-
lena_compressed = np.choose(labels, values)
44-
lena_compressed.shape = lena.shape
50+
face_compressed = np.choose(labels, values)
51+
face_compressed.shape = face.shape
4552

46-
vmin = lena.min()
47-
vmax = lena.max()
53+
vmin = face.min()
54+
vmax = face.max()
4855

49-
# original lena
56+
# original face
5057
plt.figure(1, figsize=(3, 2.2))
51-
plt.imshow(lena, cmap=plt.cm.gray, vmin=vmin, vmax=256)
58+
plt.imshow(face, cmap=plt.cm.gray, vmin=vmin, vmax=256)
5259

53-
# compressed lena
60+
# compressed face
5461
plt.figure(2, figsize=(3, 2.2))
55-
plt.imshow(lena_compressed, cmap=plt.cm.gray, vmin=vmin, vmax=vmax)
62+
plt.imshow(face_compressed, cmap=plt.cm.gray, vmin=vmin, vmax=vmax)
5663

57-
# equal bins lena
64+
# equal bins face
5865
regular_values = np.linspace(0, 256, n_clusters + 1)
59-
regular_labels = np.searchsorted(regular_values, lena) - 1
66+
regular_labels = np.searchsorted(regular_values, face) - 1
6067
regular_values = .5 * (regular_values[1:] + regular_values[:-1]) # mean
61-
regular_lena = np.choose(regular_labels.ravel(), regular_values)
62-
regular_lena.shape = lena.shape
68+
regular_face = np.choose(regular_labels.ravel(), regular_values, mode="clip")
69+
regular_face.shape = face.shape
6370
plt.figure(3, figsize=(3, 2.2))
64-
plt.imshow(regular_lena, cmap=plt.cm.gray, vmin=vmin, vmax=vmax)
71+
plt.imshow(regular_face, cmap=plt.cm.gray, vmin=vmin, vmax=vmax)
6572

6673
# histogram
6774
plt.figure(4, figsize=(3, 2.2))

0 commit comments

Comments
 (0)