From 1a5f412d26b3009a09c7e79d5bca89f3ab67dabf Mon Sep 17 00:00:00 2001 From: Fabian Pedregosa <fabian.pedregosa@inria.fr> Date: Wed, 20 Oct 2010 11:36:53 +0200 Subject: [PATCH] Revert "Update svm examples affected by latest API changes." This reverts commit 8606d6f010837cd9401941bb19176158fcf43899. --- examples/svm/plot_separating_hyperplane.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/svm/plot_separating_hyperplane.py b/examples/svm/plot_separating_hyperplane.py index e871c37796..edc6ca4270 100644 --- a/examples/svm/plot_separating_hyperplane.py +++ b/examples/svm/plot_separating_hyperplane.py @@ -1,11 +1,8 @@ """ =========================================== -SVM: Maximum margin separating hyperplane +SVM: Maximum separating margin hyperplane =========================================== -Plot the maximum margin separating hyperplane within a two-class -separable dataset using a Support Vector Machines classifier with -linear kernel. """ import numpy as np @@ -29,9 +26,9 @@ yy = a*xx - (clf.intercept_[0])/w[1] # plot the parallels to the separating hyperplane that pass through the # support vectors -b = clf.support_vectors_[0] +b = clf.support_[0] yy_down = a*xx + (b[1] - a*b[0]) -b = clf.support_vectors_[-1] +b = clf.support_[-1] yy_up = a*xx + (b[1] - a*b[0]) # plot the line, the points, and the nearest vectors to the plane @@ -40,7 +37,7 @@ pl.plot(xx, yy, 'k-') pl.plot(xx, yy_down, 'k--') pl.plot(xx, yy_up, 'k--') pl.scatter(X[:,0], X[:,1], c=Y) -pl.scatter(clf.support_vectors_[:,0], clf.support_vectors_[:,1], c='white') +pl.scatter(clf.support_[:,0], clf.support_[:,1], marker='+') pl.axis('tight') pl.show() -- GitLab