相关疑难解决方法(0)

无法理解SVM和LR中决策边界的绘图

例如,我们有f(x)= x.如何策划?我们取一些x然后计算y并再次执行此操作,然后逐点绘制图表.简单明了.

但我无法理解如此清晰地绘制决策边界 - 当我们没有绘制时,只有x.

SVM的Python代码:

h = .02  # step size in the mesh
Y = y
# we create an instance of SVM and fit out data. We do not scale our
# data since we want to plot the support vectors
C = 1.0  # SVM regularization parameter
svc = svm.SVC(kernel='linear', C=C).fit(X, Y)
rbf_svc = svm.SVC(kernel='rbf', gamma=0.7, C=C).fit(X, Y)
poly_svc = svm.SVC(kernel='poly', degree=3, C=C).fit(X, Y)
lin_svc = svm.LinearSVC(C=C).fit(X, Y)

# create a mesh to plot in
x_min, …
Run Code Online (Sandbox Code Playgroud)

python numpy machine-learning svm svc

1
推荐指数
1
解决办法
3701
查看次数

标签 统计

machine-learning ×1

numpy ×1

python ×1

svc ×1

svm ×1