From ea7ad29123735a625d620b5ea28fdfef6f2f42e7 Mon Sep 17 00:00:00 2001 From: Jaques Grobler <jaquesgrobler@gmail.com> Date: Mon, 14 Oct 2013 18:28:07 +0200 Subject: [PATCH] sort out plot_iris vs plot_svm_iris --- .../statistical_inference/supervised_learning.rst | 7 ++++--- examples/svm/plot_iris.py | 10 +++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/tutorial/statistical_inference/supervised_learning.rst b/doc/tutorial/statistical_inference/supervised_learning.rst index 6ce49a71b1..66fddfee35 100644 --- a/doc/tutorial/statistical_inference/supervised_learning.rst +++ b/doc/tutorial/statistical_inference/supervised_learning.rst @@ -439,9 +439,10 @@ the separating line (less regularization). |svm_margin_unreg| |svm_margin_reg| ============================= ============================== -.. image:: ../../auto_examples/svm/images/plot_svm_iris_1.png - :target: ../../auto_examples/svm/plot_svm_iris.html - :scale: 83 +.. topic:: Example: + + - :ref:`example_svm_plot_iris.py` + SVMs can be used in regression --:class:`SVR` (Support Vector Regression)--, or in classification --:class:`SVC` (Support Vector Classification). diff --git a/examples/svm/plot_iris.py b/examples/svm/plot_iris.py index 1c33ae2810..fa57d0127a 100644 --- a/examples/svm/plot_iris.py +++ b/examples/svm/plot_iris.py @@ -46,15 +46,23 @@ for i, clf in enumerate((svc, rbf_svc, poly_svc, lin_svc)): # Plot the decision boundary. For that, we will assign a color to each # point in the mesh [x_min, m_max]x[y_min, y_max]. pl.subplot(2, 2, i + 1) + pl.subplots_adjust(wspace=0.4, hspace=0.4) + Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) # Put the result into a color plot Z = Z.reshape(xx.shape) pl.contourf(xx, yy, Z, cmap=pl.cm.Paired) - pl.axis('off') # Plot also the training points pl.scatter(X[:, 0], X[:, 1], c=Y, cmap=pl.cm.Paired) + pl.xlabel('Sepal length') + pl.ylabel('Sepal width') + + pl.xlim(xx.min(), xx.max()) + pl.ylim(yy.min(), yy.max()) + pl.xticks(()) + pl.yticks(()) pl.title(titles[i]) -- GitLab