Skip to content

Commit e7b815f

Browse files
committed
📝 svm可视化边界fix
1 parent 7eac77f commit e7b815f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SVM/SVM_scikit-learn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def plot_decisionBoundary(X,y,model,class_='linear'):
4646
if class_=='linear':
4747
w = model.coef_
4848
b = model.intercept_
49-
xp = np.linspace(np.min(X[:,0]),np.max(X[:,1]),100)
49+
xp = np.linspace(np.min(X[:,0]),np.max(X[:,0]),100)
5050
yp = -(w[0,0]*xp+b)/w[0,1]
5151
plt.plot(xp,yp,'b-',linewidth=2.0)
5252
plt.show()

0 commit comments

Comments
 (0)