From c9abe509af6d394127bbf2945a38b0e4508dbdfb Mon Sep 17 00:00:00 2001 From: Alexandre Gramfort <alexandre.gramfort@inria.fr> Date: Sat, 27 Nov 2010 18:21:05 -0500 Subject: [PATCH] pep8 in plot_weighted_samples.py --- examples/svm/plot_weighted_samples.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/svm/plot_weighted_samples.py b/examples/svm/plot_weighted_samples.py index 1a55dae92d..caaaafdc67 100644 --- a/examples/svm/plot_weighted_samples.py +++ b/examples/svm/plot_weighted_samples.py @@ -14,7 +14,7 @@ from scikits.learn import svm # we create 20 points np.random.seed(0) -X = np.r_[np.random.randn(10, 2) + [1,1], np.random.randn(10, 2)] +X = np.r_[np.random.randn(10, 2) + [1, 1], np.random.randn(10, 2)] Y = [1]*10 + [-1]*10 sample_weight = 100 * np.abs(np.random.randn(20)) # and assign a bigger weight to the last 10 samples @@ -27,7 +27,6 @@ clf.fit(X, Y, sample_weight=sample_weight) # get the separating hyperplane xx, yy = np.meshgrid(np.linspace(-4, 5, 500), np.linspace(-4, 5, 500)) - # plot the line, the points, and the nearest vectors to the plane Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) Z = Z.reshape(xx.shape) @@ -35,8 +34,7 @@ Z = Z.reshape(xx.shape) # plot the line, the points, and the nearest vectors to the plane pl.set_cmap(pl.cm.bone) pl.contourf(xx, yy, Z, alpha=0.75) -pl.scatter(X[:,0], X[:,1], c=Y, s=sample_weight, alpha=0.9) +pl.scatter(X[:, 0], X[:, 1], c=Y, s=sample_weight, alpha=0.9) pl.axis('tight') pl.show() - -- GitLab