8000 DOC Fixup of linear svm separating hyperplane plot (#9471) · CoderPat/scikit-learn@5fef319 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5fef319

Browse files
amuellerjnothman
authored andcommitted
DOC Fixup of linear svm separating hyperplane plot (scikit-learn#9471)
* change data, don't regularize, call plt.show
1 parent 8d7396c commit 5fef319

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/svm/plot_separating_hyperplane.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717

1818
# we create 40 separable points
19-
X, y = make_blobs(n_samples=40, centers=2, random_state=12, cluster_std=0.35)
19+
X, y = make_blobs(n_samples=40, centers=2, random_state=6)
2020

21-
# fit the model
22-
clf = svm.SVC(kernel='linear')
21+
# fit the model, don't regularize for illustration purposes
22+
clf = svm.SVC(kernel='linear', C=1000)
2323
clf.fit(X, y)
2424

2525
plt.scatter(X[:, 0], X[:, 1], c=y, s=30, cmap=plt.cm.Paired)
@@ -42,3 +42,4 @@
4242
# plot support vectors
4343
ax.scatter(clf.support_vectors_[:, 0], clf.support_vectors_[:, 1], s=100,
4444
linewidth=1, facecolors='none')
45+
plt.show()

0 commit comments

Comments
 (0)
0