svm

svm

計算機算法術語
在機器學習領域,支持向量機SVM(Support Vector Machine)是一個有監督的學習模型,通常用來進行模式識别、分類、以及回歸分析。SVM(Support Vector Machine)是二元分類算法。給定一組2種類型的N維的地方點,SVM(Support Vector Machine)産生一個(N-1)維超平面到這些點分成2組。假設你有2種類型的點,且它們是線性可分的。SVM(Support Vector Machine)将找到一條直線将這些點分成2種類型,并且這條直線會盡可能地遠離所有的點。[1]
    中文名:支持向量機 外文名:Support Vector Machine 所屬學科: 所屬方向:機器學習 屬性:是一個有監督的學習模型

簡介

1、線性可分支持向量機:給定線性可分的訓練數據集,通過(硬)間隔最大化或者等價的求解相應的凸二次規劃問題學習得到的分離超平面為:w∗x+b=0w∗x+b=0以及相應的分類決策函數: f(x)=sign(w∗x)+bf(x)=sign(w∗x)+b。

2、線性支持向量機給定線性不可分的訓練數據集,通過軟件間隔最大化或者等價的求解相應的凸二次規劃問題學習得到的分離超平面為:w∗x+b=0w∗x+b=0以及相應的分類決策函數: f(x)=sign(w∗x)+bf(x)=sign(w∗x)+b。

3、非線性支持向量機從非線性分類訓練集,通過核函數與軟間隔最大化,或者凸二次優化,學習得到的分類決策函數f(x)=sign(∑i=1NαiyIK(x,xi)+b)f(x)=sign(∑i=1NαiyIK(x,xi)+b)其中,K(x,z)K(x,z) 是正定核函數。

基本情況

Vapnik等人在多年研究統計學習理論基礎上對線性分類器提出了另一種設計最佳準則。其原理也從線性可分說起,然後擴展到線性不可分的情況。甚至擴展到使用非線性函數中去,這種分類器被稱為支持向量機(Support Vector Machine,簡稱SVM)。支持向量機的提出有很深的理論背景。

支持向量機方法是在後來提出的一種新方法。

SVM的主要思想可以概括為兩點:

⑴它是針對線性可分情況進行分析,對于線性不可分的情況,通過使用非線性映射算法将低維輸入空間線性不可分的樣本轉化為高維特征空間使其線性可分,從而 使得高維特征空間采用線性算法對樣本的非線性特征進行線性分析成為可能;

例子

如右圖:

将1維的“線性不可分”上升到2維後就成為線性可分了。

⑵它基于結構風險最小化理論之上在特征空間中建構最優分割超平面,使得學習器得到全局最優化,并且在整個樣本空間的期望風險以某個概率滿足一定上界。

在學習這種方法時,首先要弄清楚這種方法考慮問題的特點,這就要從線性可分的最簡單情況讨論起,在沒有弄懂其原理之前,不要急于學習線性不可分等較複雜的情況,支持向量機在設計時,需要用到條件極值問題的求解,因此需用拉格朗日乘子理論,但對多數人來說,以前學到的或常用的是約束條件為等式表示的方式,但在此要用到以不等式作為必須滿足的條件,此時隻要了解拉格朗日理論的有關結論就行。

一般特征

(1)SVM學習問題可以表示為凸優化問題,因此可以利用已知的有效算法發現目标函數的全局最小值。而其他分類方法(如基于規則的分類器和人工神經網絡)都采用一種基于貪心學習的策略來搜索假設空間,這種方法一般隻能獲得局部最優解。

(2)SVM通過最大化決策邊界的邊緣來控制模型的能力。盡管如此,用戶必須提供其他參數,如使用核函數類型和引入松弛變量等。

(3)通過對數據中每個分類屬性引入一個啞變量,SVM可以應用于分類數據。

(4)SVM一般隻能用在二類問題,對于多類問題效果不好。

原理簡介

SVM方法是通過一個非線性映射p,把樣本空間映射到一個高維乃至無窮維的特征空間中(Hilbert空間),使得在原來的樣本空間中非線性可分的問題轉化為在特征空間中的線性可分的問題.簡單地說,就是升維和線性化.升維,就是把樣本向高維空間做映射,一般情況下這會增加計算的複雜性,甚至會引起“維數災難”,因而人們很少問津.但是作為分類、回歸等問題來說,很可能在低維樣本空間無法線性處理的樣本集,在高維特征空間中卻可以通過一個線性超平面實現線性劃分(或回歸).一般的升維都會帶來計算的複雜化,SVM方法巧妙地解決了這個難題:應用核函數的展開定理,就不需要知道非線性映射的顯式表達式;由于是在高維特征空間中建立線性學習機,所以與線性模型相比,不但幾乎不增加計算的複雜性,而且在某種程度上避免了“維數災難”.這一切要歸功于核函數的展開和計算理論.

選擇不同的核函數,可以生成不同的SVM,常用的核函數有以下4種:

線性核函數K(x,y)=x·y;

多項式核函數K(x,y)=[(x·y)+1]^d;

徑向基函數K(x,y)=exp(-|x-y|^2/d^2)

二層神經網絡核函數K(x,y)=tanh(a(x·y)+b).

語言

C/C++

Lush -- an Lisp-like interpreted/compiled language with C/C++/Fortran interfaces that haspackages 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 SVMShogun - 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

TinySVM -- a small SVM implementation,written in C++

R

e1071 - Machine learning library for R

Matlab

SimpleSVM - SimpleSVM toolbox for Matlab

SVM and Kernel Methods Matlab Toolbox

PCP -- C program for supervised pattern classification. Includes LIBSVM wrapper.

python

numpy -fundamental package for scientific computing with Python

scipy -package of tools for science and engineering for Python

主要軟件

Lush--anLisp-likeinterpreted/compiledlanguagewithC/C++/FortraninterfacesthathaspackagestointerfacetoanumberofdifferentSVMimplementations.InterfacestoLASVM,LIBSVM,mySVM,SVQP,SVQP2(SVQP3infuture)areavailable.LeveragetheseagainstLush'sotherinterfacestomachinelearning,hiddenmarkovmodels,numericallibraries(LAPACK,BLAS,GSL),andbuiltinvector/matrix/tensorengine.

SVMlight--apopularimplementationoftheSVMalgorithmbyThorstenJoachims;itcanbeusedtosolveclassification,regressionandrankingproblems.

LIBSVM--ALibraryforSupportVectorMachines,Chih-ChungChangandChih-JenLin

YALE--apowerfulmachinelearningtoolboxcontainingwrappersforSVMLight,LibSVM,andMySVMinadditiontomanyevaluationandpreprocessingmethods.

LS-SVMLab-Matlab/CSVMtoolbox-well-documented,manyfeatures

Gist--implementationoftheSVMalgorithmwithfeatureselection.

Weka--amachinelearningtoolkitthatincludesanimplementationofanSVMclassifier;Wekacanbeusedbothinteractivelythoughagraphicalinterfaceorasasoftwarelibrary.(Oneofthemiscalled"SMO".IntheGUIWekaexplorer,itisunderthe"classify"tabifyou"Choose"analgorithm.)

OSUSVM-MatlabimplementationbasedonLIBSVM

Torch-C++machinelearninglibrarywithSVMShogun-LargeScaleMachineLearningToolboxwithinterfacestoOctave,Matlab,Python,R

Spider-MachinelearninglibraryforMatlab

kernlab-Kernel-basedMachineLearninglibraryforR

e1071-MachinelearninglibraryforR

SimpleSVM-SimpleSVMtoolboxforMatlab

SVMandKernelMethodsMatlabToolbox

PCP--Cprogramforsupervisedpatternclassification.IncludesLIBSVMwrapper.

TinySVM--asmallSVMimplementation,writteninC++

相關詞條

相關搜索

其它詞條