支持向量机--转
原文地址:https://zh.wikipedia.org/wiki/%E6%94%AF%E6%8C%81%E5%90%91%E9%87%8F%E6%9C%BA
支持向量機(英語:Support Vector Machine,常簡稱為SVM)是一種監督式學習的方法,可廣泛地應用于統計分類以及回歸分析。
支持向量機屬于一般化線性分類器,也可以被認為是提克洛夫規范化(Tikhonov Regularization)方法的一個特例。這族分類器的特點是他們能夠同時最小化經驗誤差與最大化幾何邊緣區,因此支持向量機也被稱為最大邊緣區分類器。
?
目錄
??[隱藏]?- 1介紹
- 2線性支持向量機
- 2.1問題定義
- 2.2原型
- 2.3對偶型
- 2.4支持向量機之后驗
- 3軟間隔(Soft margin)
- 4非線性分類
- 5數值最佳化問題的解法
- 6延伸模型
- 7應用
- 8參見
- 9參考書目
- 10外部鏈接
- 10.1概念
- 10.2軟件
- 10.3互動SVM應用
?
介紹
有很多個分類器(超平面)可以把數據分開,但是只有一個能夠達到最大間隔。支持向量機建構一個或多個高維(甚至是無限多維)的超平面來分類資料點,這個超平面即為分類邊界。直觀來說,好的分類邊界要距離最近的訓練資料點越遠越好,因為這樣可以減低分類器的泛化誤差。在支持向量機中,分類邊界與最近的訓練資料點之間的距離稱為間隔(margin);支持向量機的目標即為找出間隔最大的超平面來作為分類邊界。
支持向量機的支持向量指的就是與分類邊界距離最近的訓練資料點。從支持向量機的最佳化問題可以推導出一個重要性質:支持向量機的分類邊界可由支持向量決定,而與其他資料點無關。這也是它們稱為“支持向量”的原因。
我們通常希望分類的過程是一個機器學習的過程。這些數據點并不需要是{\displaystyle \mathbb {R} ^{2}}中的點,而可以是任意{\displaystyle \mathbb {R} ^{p}}(統計學符號)中或者{\displaystyle \mathbb {R} ^{n}}(計算機科學符號)的點。我們希望能夠把這些點通過一個n-1維的超平面分開,通常這個被稱為線性分類器。有很多分類器都符合這個要求,但是我們還希望找到分類最佳的平面,即使得屬于兩個不同類的數據點間隔最大的那個面,該面亦稱為最大間隔超平面。如果能夠找到這個面,那么這個分類器就稱為最大間隔分類器。
線性支持向量機
問題定義
設樣本屬于兩個類,用該樣本訓練svm得到的最大間隔超平面。在超平面上的樣本點也稱為支持向量。 我們考慮以下形式的{\displaystyle n}點測試集{\displaystyle {\mathcal {D}}}:
其中{\displaystyle y_{i}}是{\displaystyle -1}或者{\displaystyle 1}。
超平面的數學形式可以寫作:
其中{\displaystyle \mathbf {x} }是超平面上的點,{\displaystyle \mathbf {w} }是垂直于超平面的向量。
根據幾何知識,我們知道{\displaystyle \mathbf {w} }向量垂直于分類超平面。加入位移b的目的是增加間隔。如果沒有b的話,那超平面將不得不通過原點,限制了這個方法的靈活性。
由于我們要求最大間隔,因此我們需要知道支持向量以及(與最佳超平面)平行的并且離支持向量最近的超平面。我們可以看到這些平行超平面可以由方程族:
或是
來表示,由于{\displaystyle \mathbf {w} }只是超平面的法向量,長度未定,是一個變量,所以等式右邊的1和-1只是為計算方便而取的常量,其他常量只要互為相反數亦可。
如果這些訓練數據是線性可分的,那就可以找到這樣兩個超平面,在它們之間沒有任何樣本點并且這兩個超平面之間的距離也最大。通過幾何不難得到這兩個超平面之間的距離是2/|w|,因此我們需要最小化 |w|。同時為了使得樣本數據點都在超平面的間隔區以外,我們需要保證對于所有的{\displaystyle i}滿足其中的一個條件:
或是
這兩個式子可以寫作:
原型
現在尋找最佳超平面這個問題就變成了在(1)這個約束條件下最小化|w|.這是一個二次規劃(QPquadratic programming)最優化中的問題。
更清楚的表示:
其中{\displaystyle i=1,\dots ,n}。 1/2因子是為了數學上表達的方便加上的。
解如上約束問題,通常的想法可能是使用非負拉格朗日乘數{\displaystyle \alpha _{i}}于下式:
此式表明我們尋找一個鞍點。這樣所有可以被{\displaystyle y_{i}(\mathbf {w} \cdot \mathbf {x_{i}} -b)-1>0}分離的點就無關緊要了,因為我們必須設置相應的{\displaystyle \alpha _{i}}為零。
這個問題現在可以用標準二次規劃技術標準和程序解決。結論可以表示為如下訓練向量的線性組合
其中只有很少的{\displaystyle \alpha _{i}}會大于0.對應的{\displaystyle \mathbf {x_{i}} }就是支持向量,這些支持向量在邊緣上并且滿足{\displaystyle y_{i}(\mathbf {w} \cdot \mathbf {x_{i}} -b)=1}.由此可以推導出支持向量也滿足:
因此允許定義偏移量{\displaystyle b}.在實際應用中,把所有支持向量{\displaystyle N_{SV}}的偏移量做平均后魯棒性更強:
對偶型
把原型的分類規則寫作對偶型,可以看到分類器其實是一個關于支持向量(即那些在間隔區邊緣的訓練樣本點)的函數。
根據{\displaystyle ||\mathbf {w} ||^{2}=\mathbf {w} \cdot \mathbf {w} },并且帶入{\displaystyle \mathbf {w} =\sum _{i=1}^{n}\alpha _{i}y_{i}\mathbf {x_{i}} },可以得到支持向量機的對偶型如下:
滿足
且
這里的定義為:
{\displaystyle W}可計算并歸功于{\displaystyle \alpha }條件:
支持向量機之后驗
后驗概率對分類器非常重要,分類器的輸出必須結合后驗概率才能確定,借助后驗概率更好的改進超平面的泛化能力。
軟間隔(Soft margin)
1995年,?Corinna Cortes與Vapnik提出了一種改進的最大間隔區方法,這種方法可以處理標記錯誤的樣本。如果可區分正負例的超平面不存在,則“軟邊界”將選擇一個超平面盡可能清晰地區分樣本,同時使其與分界最清晰的樣本的距離最大化。這一成果使術語“支持向量機”(或“SVM”)得到推廣。這種方法引入了松馳參數{\displaystyle \xi _{i}}以衡量對數據{\displaystyle x_{i}}的誤分類度。
隨后,將目標函數與一個針對非0{\displaystyle \xi _{i}}的懲罰函數相加,在增大間距和縮小錯誤懲罰兩大目標之間進行權衡優化。如果懲罰函數是一個線性函數,則等式(3)變形為
非線性分類
數值最佳化問題的解法
解決問題的參數方法大多通過解決那些最優化的問題派生出來的,現有一些從SVM問題中誕生出來的可以快速解決QP問題的的算法,他們主要依靠把問題分割成更小更容易管理的模塊的方法來實現。
一個通用的算法是Platt's Sequential Minimal Optimization(SMO)算法,他把問題分成了若干個在二維空間成可以被解析的子問題,這樣避開了需要解決數值最優化問題的難度。
另一個研究就是用使用了牛頓迭代的內點法找到Karush–Kuhn–Tucker情況下原始對偶問題的解決方法。與那些解決一系列小問題不同的是,這項研究直接解決了整體部分。避開解決這個線性問題的過程離不開核矩陣,矩陣的低階近似往往是內核中使用技巧。
延伸模型
- 多元分類支持向量機
- 支持向量回歸
- 結構化支持向量機
應用
- 用于文本和超文本的分類,在歸納和直推方法中都可以顯著減少所需要的有類標的樣本數。
- 用于圖像分類。實驗結果顯示:在經過三到四輪相關反饋之后,比起傳統的查詢優化方案,支持向量機能夠取得明顯更高的搜索準確度。
- 用于醫學中分類蛋白質,超過90%的化合物能夠被正確分類。
- 用于手寫字體識別。
參見
- 相關向量機
參考書目
- B. E. Boser, I. M. Guyon, and V. N. Vapnik.?A training algorithm for optimal margin classifiers. In D. Haussler, editor, 5th Annual ACM Workshop on COLT, pages 144-152, Pittsburgh, PA, 1992. ACM Press.
- Corinna Cortes and V. Vapnik, "Support-Vector Networks, Machine Learning, 20, 1995.?[1]
- Christopher J. C. Burges. "A Tutorial on Support Vector Machines for Pattern Recognition". Data Mining and Knowledge Discovery 2:121 - 167, 1998?(Also available at?CiteSeer:?[2])
- Nello Cristianini and John Shawe-Taylor.?An Introduction to Support Vector Machines and other kernel-based learning methods. Cambridge University Press, 2000.?ISBN 0-521-78019-5?([3]?SVM Book)
- Harris Drucker, Chris J.C. Burges, Linda Kaufman, Alex Smola and Vladimir Vapnik (1997). "Support Vector Regression Machines".?Advances in Neural Information Processing Systems 9, NIPS 1996, 155-161, MIT Press.
- Huang T.-M., Kecman V., Kopriva I.(2006), Kernel Based Algorithms for Mining Huge Data Sets, Supervised, Semi-supervised, and Unsupervised Learning, Springer-Verlag, Berlin, Heidelberg, 260 pp. 96 illus., Hardcover,?ISBN 3-540-31681-7[4]
- Vojislav Kecman: "Learning and Soft Computing - Support Vector Machines, Neural Networks, Fuzzy Logic Systems", The MIT Press, Cambridge, MA, 2001.[5]
- Tapio Pahikkala, Sampo Pyysalo, Jorma Boberg, Aleksandr Myll?ri and Tapio Salakoski. Improving the Performance of Bayesian and Support Vector Classifiers in Word Sense Disambiguation using Positional Information. In Proceedings of the International and Interdisciplinary Conference on Adaptive Knowledge Representation and Reasoning(AKRR'05), Jun 2005.
- Bernhard Sch?lkopf and A. J. Smola:?Learning with Kernels. MIT Press, Cambridge, MA, 2002.?(Partly available on line:?[6].)ISBN 0-262-19475-9
- Bernhard Sch?lkopf, Christopher J.C. Burges, and Alexander J. Smola (editors). "Advances in Kernel Methods: Support Vector Learning". MIT Press, Cambridge, MA, 1999.?ISBN 0-262-19416-3.?[7]
- John Shawe-Taylor and Nello Cristianini.?Kernel Methods for Pattern Analysis. Cambridge University Press, 2004.?ISBN 0-521-81397-2?([8]?Kernel Methods Book)
- P.J. Tan and?D.L. Dowe(2004),?MML Inference of Oblique Decision Trees, Lecture Notes in Artificial Intelligence (LNAI) 3339, Springer-Verlag,?pp1082-1088. Links require password.(This paper uses?minimum message length(MML)and actually incorporates probabilistic support vector machines in the leaves of?decision trees.)
- Vladimir Vapnik.?The Nature of Statistical Learning Theory. Springer-Verlag, 1999.?ISBN 0-387-98780-0
- Chien-Yi Wang, "The fusion of support vector machine and Multi-layer Fuzzy Neural Network". Machine Learning, Jun, 2012.
外部鏈接
概念
- www.pascal-network.org?(EU Funded Network on Pattern Analysis, Statistical Modelling and Computational Learning)
- www.kernel-machines.org?(general information and collection of research papers)
- www.kernel-methods.net?(News, Links, Code related to Kernel methods - Academic Site)
- www.support-vector.net?(News, Links, Code related to Support Vector Machines - Academic Site)
- www.support-vector-machines.org?(Literature, Review, Software, Links related to Support Vector Machines - Academic Site)
- www.support-vector.ws?(Free educational MATLAB based software for SVMs, NN and FL , Links, Publications downloads, Semisupervised learning software SemiL, Links)
- A Chinese Video Lectures for Kernel Method, PCA, KPCA, LDA, GDA, and SVMs?by Cheng-Hsuan Li
- An Automatic Method for Selecting the Parameter of the RBF Kernel Function to Support Vector Machines?by Cheng-Hsuan Li, Chin-Teng Lin, Bor-Chen Kuo, and Hui-Shan Chu
- A Chinese Video Lecture for Reproducing Kernel Hilbert Space?by Cheng-Hsuan Li
軟件
- Lush?-- an Lisp-like interpreted/compiled language with C/C++/Fortran interfaces that has packages to interface to a number of different SVM implementations. Interfaces to LASVM, LIBSVM, mySVM, SVQP, SVQP2 (SVQP3 in future) are available. Leverage these against Lush's other interfaces to machine learning, hidden markov models, numerical libraries(LAPACK, BLAS, GSL), and builtin vector/matrix/tensor engine.
- SVMlight?-- a popular implementation of the SVM algorithm by Thorsten Joachims; it can be used to solve classification, regression and ranking problems.
- LIBSVM -- A Library for Support Vector Machines, Chih-Chung Chang and Chih-Jen Lin
- YALE?-- a powerful machine learning toolbox containing wrappers for SVMLight, LibSVM, and MySVM in addition to many evaluation and preprocessing methods.
- LS-SVMLab?- Matlab/C SVM toolbox - well-documented, many features
- Gist?-- implementation of the SVM algorithm with feature selection.
- Weka?-- a machine learning toolkit that includes an implementation of an SVM classifier; Weka can be used both interactively though a graphical interface or as a software library.(One of them is called "SMO". In the GUI Weka explorer, it is under the "classify" tab if you "Choose" an algorithm.)
- OSU SVM?- Matlab implementation based on LIBSVM
- Torch?- C++ machine learning library with SVM
- Shogun?- Large Scale Machine Learning Toolbox with interfaces to Octave, Matlab, Python, R
- Spider?- Machine learning library for Matlab
- kernlab?- Kernel-based Machine Learning library for R
- e1071?- Machine learning library for R
- SimpleSVM?- SimpleSVM toolbox for Matlab
- SVM and Kernel Methods Matlab Toolbox
- PCP?-- C program for supervised pattern classification. Includes LIBSVM wrapper.
- TinySVM?-- a small SVM implementation, written in C++
互動SVM應用
- ECLAT?classification of?Expressed Sequence Tag(EST)from mixed EST pools using codon usage
- EST3?classification of?Expressed Sequence Tag(EST)from mixed EST pools using nucleotide triples
轉載于:https://www.cnblogs.com/davidwang456/articles/5586239.html
總結
- 上一篇: Fisher 线性分类器--转
- 下一篇: LIBSVM -- A Library