<html>
最早是由 Vladimir N. Vapnik 和 Alexey Ya. Chervonenkis 在1963年提出
目前的版本(soft margin)是由Corinna Cortes 和 Vapnik在1993年提出,并在1995年發(fā)表
深度學(xué)習(xí)(2012)出現(xiàn)之前,SVM被認(rèn)為機(jī)器學(xué)習(xí)中近十幾年來(lái)最成功,表現(xiàn)最好的算法
訓(xùn)練集 => 提取特征向量 => 結(jié)合一定的算法(分類(lèi)器:比如決策樹(shù),KNN)=>得到結(jié)果
3.1 例子
3.2 SVM尋找區(qū)分兩類(lèi)的超平面(hyper plane), 使邊際(margin)最大
總共可以有多少個(gè)可能的超平面?無(wú)數(shù)條
如何選取使邊際(margin)最大的超平面 (Max Margin Hyperplane)?
超平面到一側(cè)最近點(diǎn)的距離等于到另一側(cè)最近點(diǎn)的距離,兩側(cè)的兩個(gè)超平面平行
from sklearn import svmx = [[2, 0], [1, 1], [3, 3],[2,6]]y = [0, 0, 1,2]clf = svm.SVC()clf.fit(x, y)print clf# get support vectorsprint clf.support_vectors_# get indices of support vectorsprint clf.support_# get number of support vectors for each classprint clf.n_support_
##輸出結(jié)果
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, decision_function_shape=None, degree=3, gamma='auto', kernel='rbf', max_iter=-1, probability=False, random_state=None, shrinking=True, tol=0.001, verbose=False)[[ 2. 0.] [ 1. 1.] [ 3. 3.] [ 2. 6.]][0 1 2 3][2 1 1]
聯(lián)系客服