Skip to content

Commit ea7ad29

Browse files
jaquesgrobleramueller
authored andcommitted
sort out plot_iris vs plot_svm_iris
1 parent 9b47992 commit ea7ad29

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

doc/tutorial/statistical_inference/supervised_learning.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,10 @@ the separating line (less regularization).
439439
|svm_margin_unreg| |svm_margin_reg|
440440
============================= ==============================
441441

442-
.. image:: ../../auto_examples/svm/images/plot_svm_iris_1.png
443-
:target: ../../auto_examples/svm/plot_svm_iris.html
444-
:scale: 83
442+
.. topic:: Example:
443+
444+
- :ref:`example_svm_plot_iris.py`
445+
445446

446447
SVMs can be used in regression --:class:`SVR` (Support Vector Regression)--, or in
447448
classification --:class:`SVC` (Support Vector Classification).

examples/svm/plot_iris.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,23 @@
4646
# Plot the decision boundary. For that, we will assign a color to each
4747
# point in the mesh [x_min, m_max]x[y_min, y_max].
4848
pl.subplot(2, 2, i + 1)
49+
pl.subplots_adjust(wspace=0.4, hspace=0.4)
50+
4951
Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])
5052

5153
# Put the result into a color plot
5254
Z = Z.reshape(xx.shape)
5355
pl.contourf(xx, yy, Z, cmap=pl.cm.Paired)
54-
pl.axis('off')
5556

5657
# Plot also the training points
5758
pl.scatter(X[:, 0], X[:, 1], c=Y, cmap=pl.cm.Paired)
59+
pl.xlabel('Sepal length')
60+
pl.ylabel('Sepal width')
61+
62+
pl.xlim(xx.min(), xx.max())
63+
pl.ylim(yy.min(), yy.max())
64+
pl.xticks(())
65+
pl.yticks(())
5866

5967
pl.title(titles[i])
6068

0 commit comments

Comments
 (0)