写出 svm 原始问题转换至其对偶问题的数学推导过程:
1 导包: from sklearn import svm
2 构建模型: clf = svm.SVC(gamma='scale')
3 训练 模型 : clf.fit(X,Y)
4 利用该模型进行预测: clf.predict([[2.,2.]])
# get support vectors: clf.support_vectors_array([[0., 0.], [1., 1.]])
# get indices of support vectors: clf.support_array([0, 1]...)
# get number of support vectors for each class: clf.n_support_array([1, 1]...)
参考 : http://scikit-learn.org/stable/modules/svm.html
svm 面试:
https://blog.csdn.net/u013793732/article/details/80117521
网友评论