我的第一个问题,请你耐心听我说:)
我在Python中使用Shogun工具箱来处理SVM。为了更好地理解支持向量机,我先做了一些实验,用Python语言编写了一些数据点来线性分离。我使用LibSVM()
X = np.array([[2.0, 2.0, 1.0, 1.0],
[1.0, -1.0, 1.0, -1.0]])
Y = np.array([[4.0, 5.0, 5.0, 4.0],
[1.0, 1.0, -1.0, -1.0]])
在用给定的数据训练支持向量机之后,我可以检索它的偏差(get_bias()
)、支持向量(get_support_vectors()
)和其他属性。我做不到的是绘制直线/超平面。我知道超平面的方程是y=wx + b
,但是如何写下/画出这个来在我的图中看到它。在
一个完整的例子
相关问题 更多 >
编程相关推荐