SVM

1.4. Support Vector Machines

支持向量機

Support vector machines (SVMs) are a set of supervised learning methods used for classification, regression and outliers detection.

支持向量機是一種用于分類,回歸和異常值檢測的監(jiān)督學習方式对室。

The advantages of support vector machines are:

SVM的優(yōu)點如下:

Effective in high dimensional spaces.

在多維度空間中具有高效性模燥。

Still effective in cases where number of dimensions is greater than the number of samples.

在特征值大于樣本數(shù)情況下仍舊高效。

Uses a subset of training points in the decision function (called support vectors), so it is also memory efficient.

在決定函數(shù)(稱為支持向量)中使用訓練集數(shù)據(jù)的一個子集掩宜,因此內(nèi)存表現(xiàn)也高效蔫骂。

Versatile: different Kernel functions can be specified for the decision function. Common kernels are provided, but it is also possible to specify custom kernels.

多功能性:可以為決定函數(shù)指定不同的核函數(shù)。提供常用的核函數(shù)牺汤,也可以指定你所習慣的核函數(shù)辽旋。

The disadvantages of support vector machines include:

缺點如下:

If the number of features is much greater than the number of samples, the method is likely to give poor performances.

如果特征值數(shù)遠遠超過樣本數(shù),SVM性能可能不太好。

SVMs do not directly provide probability estimates, these are calculated using an expensive five-fold cross-validation (see Scores and probabilities, below).

SVM不直接提供概率評估补胚,而是使用開銷五倍的交叉驗證來計算()

The support vector machines in scikit-learn support both dense (numpy.ndarray and convertible to that by numpy.asarray) and sparse (any scipy.sparse) sample vectors as input. However, to use an SVM to make predictions for sparse data, it must have been fit on such data. For optimal performance, use C-ordered numpy.ndarray (dense) or scipy.sparse.csr_matrix (sparse) with dtype=float64.

scikit-learn里的支持向量機同時支持dense(numpy中的ndarray數(shù)組和其他轉(zhuǎn)化成ndarray的數(shù)組)和sparse(scipy.sparse)樣本向量作為輸入码耐。然而如果用SVM來對sparse數(shù)據(jù)做預測,要保證數(shù)據(jù)已經(jīng)被適配溶其。

SVC, NuSVC and LinearSVC are classes capable of performing multi-class classification on a dataset.

SVN骚腥,NuSVC 和LinearSVC都可以用來進行數(shù)據(jù)的多類分類。

../_images/plot_iris_0012.png

SVC and NuSVC are similar methods, but accept slightly different sets of parameters and have different mathematical formulations (see section Mathematical formulation). On the other hand, LinearSVC is another implementation of Support Vector Classification for the case of a linear kernel. Note that LinearSVC does not accept keyword kernel, as this is assumed to be linear. It also lacks some of the members of SVC and NuSVC, like support_.

As other classifiers, SVC, NuSVC and LinearSVC take as input two arrays: an array X of size [n_samples, n_features] holding the training samples, and an array y of class labels (strings or integers), size [n_samples]:

?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末瓶逃,一起剝皮案震驚了整個濱河市束铭,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌厢绝,老刑警劉巖契沫,帶你破解...
    沈念sama閱讀 221,548評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異昔汉,居然都是意外死亡懈万,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,497評論 3 399
  • 文/潘曉璐 我一進店門靶病,熙熙樓的掌柜王于貴愁眉苦臉地迎上來钞速,“玉大人,你說我怎么就攤上這事嫡秕。” “怎么了苹威?”我有些...
    開封第一講書人閱讀 167,990評論 0 360
  • 文/不壞的土叔 我叫張陵昆咽,是天一觀的道長。 經(jīng)常有香客問我牙甫,道長掷酗,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,618評論 1 296
  • 正文 為了忘掉前任窟哺,我火速辦了婚禮泻轰,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘且轨。我一直安慰自己浮声,他們只是感情好,可當我...
    茶點故事閱讀 68,618評論 6 397
  • 文/花漫 我一把揭開白布旋奢。 她就那樣靜靜地躺著泳挥,像睡著了一般。 火紅的嫁衣襯著肌膚如雪至朗。 梳的紋絲不亂的頭發(fā)上屉符,一...
    開封第一講書人閱讀 52,246評論 1 308
  • 那天,我揣著相機與錄音,去河邊找鬼矗钟。 笑死唆香,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的吨艇。 我是一名探鬼主播躬它,決...
    沈念sama閱讀 40,819評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼秸应!你這毒婦竟也來了虑凛?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,725評論 0 276
  • 序言:老撾萬榮一對情侶失蹤软啼,失蹤者是張志新(化名)和其女友劉穎桑谍,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體祸挪,經(jīng)...
    沈念sama閱讀 46,268評論 1 320
  • 正文 獨居荒郊野嶺守林人離奇死亡锣披,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,356評論 3 340
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了贿条。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片雹仿。...
    茶點故事閱讀 40,488評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖整以,靈堂內(nèi)的尸體忽然破棺而出胧辽,到底是詐尸還是另有隱情,我是刑警寧澤公黑,帶...
    沈念sama閱讀 36,181評論 5 350
  • 正文 年R本政府宣布邑商,位于F島的核電站,受9級特大地震影響凡蚜,放射性物質(zhì)發(fā)生泄漏人断。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,862評論 3 333
  • 文/蒙蒙 一朝蜘、第九天 我趴在偏房一處隱蔽的房頂上張望恶迈。 院中可真熱鬧,春花似錦谱醇、人聲如沸暇仲。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,331評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽熔吗。三九已至,卻和暖如春佳晶,著一層夾襖步出監(jiān)牢的瞬間桅狠,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,445評論 1 272
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留中跌,地道東北人咨堤。 一個月前我還...
    沈念sama閱讀 48,897評論 3 376
  • 正文 我出身青樓,卻偏偏與公主長得像漩符,于是被迫代替她去往敵國和親一喘。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 45,500評論 2 359

推薦閱讀更多精彩內(nèi)容

  • 2017年3月14日 星期二 陰 讀經(jīng):《易經(jīng)》第31遍萎战。運動:掄胳膊300下,蹲墻30下舆逃,閉眼金雞獨立5分鐘蚂维,...
    順德琪佳媽閱讀 437評論 1 3
  • 最近所在的的城市被陰雨天搶走了燦爛的陽光。電話回家路狮,家里和我這一樣而且還下了湯圓大的冰雹虫啥。清明前后茶樹也慢慢...
    小手點點閱讀 388評論 0 0
  • 早上上班時間太早,自己做早餐往往時間來不及奄妨,路邊攤的餐點雖然方便快捷涂籽,但是衛(wèi)生問題還是讓人不太放心,而且不一...
    素心齋閱讀 585評論 0 0