Jump to content

Edit filter log

Details for log entry 37,830,044

01:06, 24 May 2024: Fredklaus2278 (talk | contribs) triggered filter 833, performing the action "edit" on Support vector machine. Actions taken: none; Filter description: Newer user possibly adding unreferenced or improperly referenced material (examine | diff)

Changes made in edit

In [[machine learning]], '''support vector machines''' ('''SVMs''', also '''support vector networks'''<ref name="CorinnaCortes" />) are [[supervised learning|supervised]] [[Maximum-margin hyperplane|max-margin]] models with associated learning [[algorithm]]s that analyze data for [[Statistical classification|classification]] and [[regression analysis]]. Developed at [[AT&T Bell Laboratories]] by [[Vladimir Vapnik]] with colleagues (Boser et al., 1992, [[Isabelle Guyon|Guyon]] et al., 1993, [[Corinna Cortes|Cortes]] and [[Vladimir Vapnik|Vapnik]], 1995,<ref name="CorinnaCortes" /> Vapnik et al., 1997<ref>{{Cite journal |last=Vapnik |first=Vladimir N. |date=1997 |editor-last=Gerstner |editor-first=Wulfram |editor2-last=Germond |editor2-first=Alain |editor3-last=Hasler |editor3-first=Martin |editor4-last=Nicoud |editor4-first=Jean-Daniel |title=The Support Vector method |url=https://link.springer.com/chapter/10.1007/BFb0020166 |journal=Artificial Neural Networks — ICANN'97 |language=en |location=Berlin, Heidelberg |publisher=Springer |pages=261–271 |doi=10.1007/BFb0020166 |isbn=978-3-540-69620-9}}</ref>) SVMs are one of the most studied models, being based on statistical learning frameworks of [[VC theory]] proposed by Vapnik (1982, 1995) and [[Alexey Chervonenkis|Chervonenkis]] (1974).
In [[machine learning]], '''support vector machines''' ('''SVMs''', also '''support vector networks'''<ref name="CorinnaCortes" />) are [[supervised learning|supervised]] [[Maximum-margin hyperplane|max-margin]] models with associated learning [[algorithm]]s that analyze data for [[Statistical classification|classification]] and [[regression analysis]]. Developed at [[AT&T Bell Laboratories]] by [[Vladimir Vapnik]] with colleagues (Boser et al., 1992, [[Isabelle Guyon|Guyon]] et al., 1993, [[Corinna Cortes|Cortes]] and [[Vladimir Vapnik|Vapnik]], 1995,<ref name="CorinnaCortes" /> Vapnik et al., 1997<ref>{{Cite journal |last=Vapnik |first=Vladimir N. |date=1997 |editor-last=Gerstner |editor-first=Wulfram |editor2-last=Germond |editor2-first=Alain |editor3-last=Hasler |editor3-first=Martin |editor4-last=Nicoud |editor4-first=Jean-Daniel |title=The Support Vector method |url=https://link.springer.com/chapter/10.1007/BFb0020166 |journal=Artificial Neural Networks — ICANN'97 |language=en |location=Berlin, Heidelberg |publisher=Springer |pages=261–271 |doi=10.1007/BFb0020166 |isbn=978-3-540-69620-9}}</ref>) SVMs are one of the most studied models, being based on statistical learning frameworks of [[VC theory]] proposed by Vapnik (1982, 1995) and [[Alexey Chervonenkis|Chervonenkis]] (1974).


In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive.
In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], which represent the data only through a set of pairwise similarity comparisons between the original data observations and representing the data by these transformed coordinates in the higher dimensional feature space. Thus, SVMs use the kernel trick to implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive.


The support vector clustering<ref name="HavaSiegelmann">{{cite journal |last1=Ben-Hur |first1=Asa |last2=Horn |first2=David |last3=Siegelmann |first3=Hava |last4=Vapnik |first4=Vladimir N. |title="Support vector clustering" (2001); |journal=Journal of Machine Learning Research |volume=2 |pages=125–137}}</ref> algorithm, created by [[Hava Siegelmann]] and [[Vladimir Vapnik]], applies the statistics of support vectors, developed in the support vector machines algorithm, to categorize unlabeled data.{{Citation needed|date=March 2018}} These data sets require [[unsupervised learning]] approaches, which attempt to find natural [[Cluster analysis|clustering of the data]] to groups and, then, to map new data according to these clusters.
The support vector clustering<ref name="HavaSiegelmann">{{cite journal |last1=Ben-Hur |first1=Asa |last2=Horn |first2=David |last3=Siegelmann |first3=Hava |last4=Vapnik |first4=Vladimir N. |title="Support vector clustering" (2001); |journal=Journal of Machine Learning Research |volume=2 |pages=125–137}}</ref> algorithm, created by [[Hava Siegelmann]] and [[Vladimir Vapnik]], applies the statistics of support vectors, developed in the support vector machines algorithm, to categorize unlabeled data.{{Citation needed|date=March 2018}} These data sets require [[unsupervised learning]] approaches, which attempt to find natural [[Cluster analysis|clustering of the data]] to groups and, then, to map new data according to these clusters.

Action parameters

VariableValue
Edit count of the user ($1) (user_editcount)
36
Name of the user account ($1) (user_name)
'Fredklaus2278'
Age of the user account ($1) (user_age)
5441491
Groups (including implicit) the user is in ($1) (user_groups)
[ 0 => '*', 1 => 'user', 2 => 'autoconfirmed' ]
Rights that the user has ($1) (user_rights)
[ 0 => 'createaccount', 1 => 'read', 2 => 'edit', 3 => 'createtalk', 4 => 'writeapi', 5 => 'viewmyprivateinfo', 6 => 'editmyprivateinfo', 7 => 'editmyoptions', 8 => 'abusefilter-log-detail', 9 => 'urlshortener-create-url', 10 => 'centralauth-merge', 11 => 'abusefilter-view', 12 => 'abusefilter-log', 13 => 'vipsscaler-test', 14 => 'collectionsaveasuserpage', 15 => 'reupload-own', 16 => 'move-rootuserpages', 17 => 'createpage', 18 => 'minoredit', 19 => 'editmyusercss', 20 => 'editmyuserjson', 21 => 'editmyuserjs', 22 => 'sendemail', 23 => 'applychangetags', 24 => 'viewmywatchlist', 25 => 'editmywatchlist', 26 => 'spamblacklistlog', 27 => 'mwoauthmanagemygrants', 28 => 'reupload', 29 => 'upload', 30 => 'move', 31 => 'autoconfirmed', 32 => 'editsemiprotected', 33 => 'skipcaptcha', 34 => 'ipinfo', 35 => 'ipinfo-view-basic', 36 => 'transcode-reset', 37 => 'transcode-status', 38 => 'createpagemainns', 39 => 'movestable', 40 => 'autoreview' ]
Whether or not a user is editing through the mobile interface ($1) (user_mobile)
false
Whether the user is editing from mobile app ($1) (user_app)
false
Page ID ($1) (page_id)
65309
Page namespace ($1) (page_namespace)
0
Page title without namespace ($1) (page_title)
'Support vector machine'
Full page title ($1) (page_prefixedtitle)
'Support vector machine'
Edit protection level of the page ($1) (page_restrictions_edit)
[]
Page age in seconds ($1) (page_age)
688715288
Action ($1) (action)
'edit'
Edit summary/reason ($1) (summary)
'clarified the kernel trick'
Time since last page edit in seconds ($1) (page_last_edit_age)
646890
Old content model ($1) (old_content_model)
'wikitext'
New content model ($1) (new_content_model)
'wikitext'
Old page wikitext, before the edit ($1) (old_wikitext)
'{{short description|Set of methods for supervised statistical learning}} {{Machine learning|Supervised learning}} In [[machine learning]], '''support vector machines''' ('''SVMs''', also '''support vector networks'''<ref name="CorinnaCortes" />) are [[supervised learning|supervised]] [[Maximum-margin hyperplane|max-margin]] models with associated learning [[algorithm]]s that analyze data for [[Statistical classification|classification]] and [[regression analysis]]. Developed at [[AT&T Bell Laboratories]] by [[Vladimir Vapnik]] with colleagues (Boser et al., 1992, [[Isabelle Guyon|Guyon]] et al., 1993, [[Corinna Cortes|Cortes]] and [[Vladimir Vapnik|Vapnik]], 1995,<ref name="CorinnaCortes" /> Vapnik et al., 1997<ref>{{Cite journal |last=Vapnik |first=Vladimir N. |date=1997 |editor-last=Gerstner |editor-first=Wulfram |editor2-last=Germond |editor2-first=Alain |editor3-last=Hasler |editor3-first=Martin |editor4-last=Nicoud |editor4-first=Jean-Daniel |title=The Support Vector method |url=https://link.springer.com/chapter/10.1007/BFb0020166 |journal=Artificial Neural Networks — ICANN'97 |language=en |location=Berlin, Heidelberg |publisher=Springer |pages=261–271 |doi=10.1007/BFb0020166 |isbn=978-3-540-69620-9}}</ref>) SVMs are one of the most studied models, being based on statistical learning frameworks of [[VC theory]] proposed by Vapnik (1982, 1995) and [[Alexey Chervonenkis|Chervonenkis]] (1974). In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive. The support vector clustering<ref name="HavaSiegelmann">{{cite journal |last1=Ben-Hur |first1=Asa |last2=Horn |first2=David |last3=Siegelmann |first3=Hava |last4=Vapnik |first4=Vladimir N. |title="Support vector clustering" (2001); |journal=Journal of Machine Learning Research |volume=2 |pages=125–137}}</ref> algorithm, created by [[Hava Siegelmann]] and [[Vladimir Vapnik]], applies the statistics of support vectors, developed in the support vector machines algorithm, to categorize unlabeled data.{{Citation needed|date=March 2018}} These data sets require [[unsupervised learning]] approaches, which attempt to find natural [[Cluster analysis|clustering of the data]] to groups and, then, to map new data according to these clusters. The popularity of SVMs is likely due to their amenability to theoretical analysis, their flexibility in being applied to a wide variety of tasks, including [[Structured prediction|structured prediction problems]]. It is not clear that SVMs have better predictive performance than other linear models, such as [[logistic regression]] and [[linear regression]].{{Citation needed|date=December 2023}} == Motivation == [[Image:Svm separating hyperplanes (SVG).svg|thumb|right|H<sub>1</sub> does not separate the classes. H<sub>2</sub> does, but only with a small margin. H<sub>3</sub> separates them with the maximal margin.]] [[Statistical classification|Classifying data]] is a common task in [[machine learning]]. Suppose some given data points each belong to one of two classes, and the goal is to decide which class a ''new'' [[data point]] will be in. In the case of support vector machines, a data point is viewed as a <math>p</math>-dimensional vector (a list of <math>p</math> numbers), and we want to know whether we can separate such points with a <math>(p-1)</math>-dimensional [[hyperplane]]. This is called a [[linear classifier]]. There are many hyperplanes that might classify the data. One reasonable choice as the best hyperplane is the one that represents the largest separation, or [[Margin (machine learning)|margin]], between the two classes. So we choose the hyperplane so that the distance from it to the nearest data point on each side is maximized. If such a hyperplane exists, it is known as the ''[[maximum-margin hyperplane]]'' and the linear classifier it defines is known as a ''maximum-[[margin classifier]]''; or equivalently, the ''[[Perceptron#Convergence|perceptron of optimal stability]]''.{{Citation needed|date=June 2013}} More formally, a support vector machine constructs a [[hyperplane]] or set of hyperplanes in a high or infinite-dimensional space, which can be used for [[Statistical classification|classification]], [[Regression analysis|regression]], or other tasks like outliers detection.<ref>{{cite web |url=http://scikit-learn.org/stable/modules/svm.html |title=1.4. Support Vector Machines — scikit-learn 0.20.2 documentation |access-date=2017-11-08 |url-status=live |archive-url=https://web.archive.org/web/20171108151644/http://scikit-learn.org/stable/modules/svm.html |archive-date=2017-11-08 }}</ref> Intuitively, a good separation is achieved by the hyperplane that has the largest distance to the nearest training-data point of any class (so-called functional margin), since in general the larger the margin, the lower the [[generalization error]] of the classifier.<ref>{{cite book |first1=Trevor |last1=Hastie |author-link=Trevor Hastie |first2=Robert |last2=Tibshirani |author-link2=Robert Tibshirani |first3=Jerome |last3=Friedman |author-link3=Jerome H. Friedman |title=The Elements of Statistical Learning : Data Mining, Inference, and Prediction |location=New York |publisher=Springer |edition=Second |year=2008 |page=134 |url=https://web.stanford.edu/~hastie/Papers/ESLII.pdf#page=153 }}</ref> A lower [[generalization error]] means that the implementer is less likely to experience [[overfitting]]. [[File:Kernel_Machine.svg|thumb|Kernel machine]] Whereas the original problem may be stated in a finite-dimensional space, it often happens that the sets to discriminate are not [[Linear separability|linearly separable]] in that space. For this reason, it was proposed<ref name="ReferenceA" /> that the original finite-dimensional space be mapped into a much higher-dimensional space, presumably making the separation easier in that space. To keep the computational load reasonable, the mappings used by SVM schemes are designed to ensure that [[dot product]]s of pairs of input data vectors may be computed easily in terms of the variables in the original space, by defining them in terms of a [[Positive-definite kernel|kernel function]] <math>k(x, y)</math> selected to suit the problem.<ref>{{Cite book |last1=Press |first1=William H. |last2=Teukolsky |first2=Saul A. |last3=Vetterling |first3=William T. |last4=Flannery |first4=Brian P. |year=2007 |title=Numerical Recipes: The Art of Scientific Computing |edition=3rd |publisher=Cambridge University Press |location=New York |isbn=978-0-521-88068-8 |chapter=Section 16.5. Support Vector Machines |chapter-url=http://apps.nrbook.com/empanel/index.html#pg=883 |url-status=live |archive-url=https://web.archive.org/web/20110811154417/http://apps.nrbook.com/empanel/index.html#pg=883 |archive-date=2011-08-11 }} </ref> The hyperplanes in the higher-dimensional space are defined as the set of points whose dot product with a vector in that space is constant, where such a set of vectors is an orthogonal (and thus minimal) set of vectors that defines a hyperplane. The vectors defining the hyperplanes can be chosen to be linear combinations with parameters <math>\alpha_i</math> of images of [[feature vector]]s <math>x_i</math> that occur in the data base. With this choice of a hyperplane, the points <math>x</math> in the [[feature space]] that are mapped into the hyperplane are defined by the relation <math>\textstyle\sum_i \alpha_i k(x_i, x) = \text{constant}.</math> Note that if <math>k(x, y)</math> becomes small as <math>y</math> grows further away from <math>x</math>, each term in the sum measures the degree of closeness of the test point <math>x</math> to the corresponding data base point <math>x_i</math>. In this way, the sum of kernels above can be used to measure the relative nearness of each test point to the data points originating in one or the other of the sets to be discriminated. Note the fact that the set of points <math>x</math> mapped into any hyperplane can be quite convoluted as a result, allowing much more complex discrimination between sets that are not convex at all in the original space. == Applications == SVMs can be used to solve various real-world problems: * SVMs are helpful in [[Text categorization|text and hypertext categorization]], as their application can significantly reduce the need for labeled training instances in both the standard inductive and [[Transduction (machine learning)|transductive]] settings.<ref>{{cite book |last1=Joachims |first1=Thorsten |title=Machine Learning: ECML-98 |chapter=Text categorization with Support Vector Machines: Learning with many relevant features |volume=1398 |date=1998 |pages=137–142 |doi=10.1007/BFb0026683 |isbn=978-3-540-64417-0 |publisher=Springer |language=en|series=Lecture Notes in Computer Science |doi-access=free }}</ref> Some methods for [[shallow semantic parsing]] are based on support vector machines.<ref>{{Cite conference |last=Pradhan |first=Sameer S. |display-authors=et al. |date=2 May 2004 |title=Shallow Semantic Parsing using Support Vector Machines |url=http://www.aclweb.org/anthology/N04-1030 |conference=Proceedings of the Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics: HLT-NAACL 2004 |publisher=Association for Computational Linguistics |pages=233–240}}</ref> * [[Image classification|Classification of images]] can also be performed using SVMs. Experimental results show that SVMs achieve significantly higher search accuracy than traditional query refinement schemes after just three to four rounds of relevance feedback. This is also true for [[image segmentation]] systems, including those using a modified version SVM that uses the privileged approach as suggested by Vapnik.<ref>Vapnik, Vladimir N.: Invited Speaker. IPMU Information Processing and Management 2014).</ref><ref>{{cite book | chapter-url=https://pdfs.semanticscholar.org/917f/15d33d32062bffeb6401eee9fe71d16d6a84.pdf | s2cid=4154772 | doi=10.1007/978-3-319-16829-6_12 | chapter=Spatial-Taxon Information Granules as Used in Iterative Fuzzy-Decision-Making for Image Segmentation | title=Granular Computing and Decision-Making | series=Studies in Big Data | year=2015 | last1=Barghout | first1=Lauren | volume=10 | pages=285–318 | isbn=978-3-319-16828-9 | access-date=2018-01-08 | archive-date=2018-01-08 | archive-url=https://web.archive.org/web/20180108120422/https://pdfs.semanticscholar.org/917f/15d33d32062bffeb6401eee9fe71d16d6a84.pdf | url-status=dead }}</ref> * Classification of satellite data like [[Synthetic-aperture radar|SAR]] data using supervised SVM.<ref>{{cite arXiv |author=A. Maity |title=Supervised Classification of RADARSAT-2 Polarimetric Data for Different Land Features|year=2016|eprint=1608.00501|class=cs.CV}}</ref> * Hand-written characters can be [[Handwriting recognition|recognized]] using SVM.<ref>{{Cite journal |last=DeCoste |first=Dennis |date=2002 |title=Training Invariant Support Vector Machines |url=https://people.eecs.berkeley.edu/~malik/cs294/decoste-scholkopf.pdf |journal=Machine Learning |volume=46 |pages=161–190 |doi=10.1023/A:1012454411458 |s2cid=85843 |doi-access=free }}</ref><ref>{{Cite book|last1=Maitra|first1=D. S.|last2=Bhattacharya|first2=U.|last3=Parui|first3=S. K.|title=2015 13th International Conference on Document Analysis and Recognition (ICDAR) |chapter=CNN based common approach to handwritten character recognition of multiple scripts |date=August 2015|chapter-url=https://ieeexplore.ieee.org/document/7333916|pages=1021–1025|doi=10.1109/ICDAR.2015.7333916|isbn=978-1-4799-1805-8|s2cid=25739012}}</ref> * The SVM algorithm has been widely applied in the biological and other sciences. They have been used to classify proteins with up to 90% of the compounds classified correctly. [[Permutation test]]s based on SVM weights have been suggested as a mechanism for interpretation of SVM models.<ref>{{cite journal | pmc=3767485 | year=2013 | last1=Gaonkar | first1=B. | last2=Davatzikos | first2=C. | title=Analytic estimation of statistical significance maps for support vector machine based multi-variate image analysis and classification | journal=NeuroImage | volume=78 | pages=270–283 | doi=10.1016/j.neuroimage.2013.03.066 | pmid=23583748 }}</ref><ref>{{Cite journal |url=http://www.aramislab.fr/perso/colliot/files/media2011_remi_published.pdf |url-status=dead |doi=10.1016/j.media.2011.05.007 |title=Spatial regularization of SVM for the detection of diffusion alterations associated with stroke outcome |year=2011 |last1=Cuingnet |first1=Rémi |last2=Rosso |first2=Charlotte |last3=Chupin |first3=Marie |last4=Lehéricy |first4=Stéphane |last5=Dormont |first5=Didier |last6=Benali |first6=Habib |last7=Samson |first7=Yves |last8=Colliot |first8=Olivier |journal=Medical Image Analysis |volume=15 |issue=5 |pages=729–737 |pmid=21752695 |access-date=2018-01-08 |archive-date=2018-12-22 |archive-url=https://web.archive.org/web/20181222172844/http://www.aramislab.fr/perso/colliot/files/media2011_remi_published.pdf }}</ref> Support vector machine weights have also been used to interpret SVM models in the past.<ref>Statnikov, Alexander; Hardin, Douglas; & Aliferis, Constantin; (2006); [http://www.ccdlab.org/paper-pdfs/NIPS_2006.pdf "Using SVM weight-based methods to identify causally relevant and non-causally relevant variables"], ''Sign'', 1, 4.</ref> Posthoc interpretation of support vector machine models in order to identify features used by the model to make predictions is a relatively new area of research with special significance in the biological sciences. == History == The original SVM algorithm was invented by [[Vladimir N. Vapnik]] and [[Alexey Chervonenkis|Alexey Ya. Chervonenkis]] in 1964.{{Citation needed|date=March 2022}} In 1992, Bernhard Boser, [[Isabelle Guyon]] and [[Vladimir Vapnik]] suggested a way to create nonlinear classifiers by applying the [[kernel trick]] to maximum-margin hyperplanes.<ref name="ReferenceA">{{Cite book |doi=10.1145/130385.130401 |chapter=A training algorithm for optimal margin classifiers |title=Proceedings of the fifth annual workshop on Computational learning theory – COLT '92 |pages=144 |year=1992 |last1=Boser |first1=Bernhard E. |last2=Guyon |first2=Isabelle M. |last3=Vapnik |first3=Vladimir N. |isbn=978-0897914970 |citeseerx=10.1.1.21.3818 |s2cid=207165665 |chapter-url=http://www.clopinet.com/isabelle/Papers/colt92.ps.Z }}</ref> The "soft margin" incarnation, as is commonly used in software packages, was proposed by [[Corinna Cortes]] and Vapnik in 1993 and published in 1995.<ref name="CorinnaCortes">{{Cite journal |last1=Cortes |first1=Corinna |author-link1=Corinna Cortes |last2=Vapnik |first2=Vladimir |author-link2=Vladimir Vapnik |year=1995 |title=Support-vector networks |journal=[[Machine Learning (journal)|Machine Learning]] |volume=20 |issue=3 |pages=273–297 |doi=10.1007/BF00994018 |doi-access=free |citeseerx=10.1.1.15.9362 |s2cid=206787478 |url=http://image.diku.dk/imagecanon/material/cortes_vapnik95.pdf }}</ref> == Linear SVM == [[File:SVM margin.png|thumb|Maximum-margin hyperplane and margins for an SVM trained with samples from two classes. Samples on the margin are called the support vectors.|alt=|300x300px]] We are given a training dataset of <math>n</math> points of the form <math display="block"> (\mathbf{x}_1, y_1), \ldots, (\mathbf{x}_n, y_n),</math> where the <math>y_i</math> are either 1 or −1, each indicating the class to which the point <math>\mathbf{x}_i </math> belongs. Each <math>\mathbf{x}_i </math> is a <math>p</math>-dimensional [[Real number|real]] vector. We want to find the "maximum-margin hyperplane" that divides the group of points <math>\mathbf{x}_i</math> for which <math>y_i = 1</math> from the group of points for which <math>y_i = -1</math>, which is defined so that the distance between the hyperplane and the nearest point <math>\mathbf{x}_i </math> from either group is maximized. Any [[hyperplane]] can be written as the set of points <math>\mathbf{x}</math> satisfying <math display="block">\mathbf{w}^\mathsf{T} \mathbf{x} - b = 0,</math> where <math>\mathbf{w}</math> is the (not necessarily normalized) [[Normal (geometry)|normal vector]] to the hyperplane. This is much like [[Hesse normal form]], except that <math>\mathbf{w}</math> is not necessarily a unit vector. The parameter <math>\tfrac{b}{\|\mathbf{w}\|}</math> determines the offset of the hyperplane from the origin along the normal vector <math>\mathbf{w}</math>. === Hard-margin === If the training data is [[linearly separable]], we can select two parallel hyperplanes that separate the two classes of data, so that the distance between them is as large as possible. The region bounded by these two hyperplanes is called the "margin", and the maximum-margin hyperplane is the hyperplane that lies halfway between them. With a normalized or standardized dataset, these hyperplanes can be described by the equations : <math>\mathbf{w}^\mathsf{T} \mathbf{x} - b = 1</math> (anything on or above this boundary is of one class, with label 1) and : <math>\mathbf{w}^\mathsf{T} \mathbf{x} - b = -1</math> (anything on or below this boundary is of the other class, with label −1). Geometrically, the distance between these two hyperplanes is <math>\tfrac{2}{\|\mathbf{w}\|}</math>,<ref>{{cite web |url=https://math.stackexchange.com/q/1305925/168764 |title=Why is the SVM margin equal to <math>\frac{2}{\|\mathbf{w}\|}</math> |author= |date=30 May 2015 |website=Mathematics Stack Exchange}}</ref> so to maximize the distance between the planes we want to minimize <math>\|\mathbf{w}\|</math>. The distance is computed using the [[distance from a point to a plane]] equation. We also have to prevent data points from falling into the margin, we add the following constraint: for each <math>i</math> either <math display="block">\mathbf{w}^\mathsf{T} \mathbf{x}_i - b \ge 1 \, , \text{ if } y_i = 1,</math> or <math display="block">\mathbf{w}^\mathsf{T} \mathbf{x}_i - b \le -1 \, , \text{ if } y_i = -1.</math> These constraints state that each data point must lie on the correct side of the margin. This can be rewritten as {{NumBlk||<math display="block">y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b) \ge 1, \quad \text{ for all } 1 \le i \le n.</math>|{{EquationRef|1}}}} We can put this together to get the optimization problem: <math>\begin{align} &\underset{\mathbf{w},\;b}{\operatorname{minimize}} && \|\mathbf{w}\|_2^2\\ &\text{subject to} && y_i(\mathbf{w}^\top \mathbf{x}_i - b) \geq 1 \quad \forall i \in \{1,\dots,n\} \end{align}</math> The <math>\mathbf{w}</math> and <math>b</math> that solve this problem determine the final classifier, <math>\mathbf{x} \mapsto \sgn(\mathbf{w}^\mathsf{T} \mathbf{x} - b)</math>, where <math>\sgn(\cdot)</math> is the [[sign function]]. An important consequence of this geometric description is that the max-margin hyperplane is completely determined by those <math>\mathbf{x}_i</math> that lie nearest to it (explained below). These <math>\mathbf{x}_i</math> are called ''support vectors''. === Soft-margin === To extend SVM to cases in which the data are not linearly separable, the ''[[hinge loss]]'' function is helpful <math display="block">\max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right).</math> Note that <math>y_i</math> is the ''i''-th target (i.e., in this case, 1 or −1), and <math>\mathbf{w}^\mathsf{T} \mathbf{x}_i - b</math> is the ''i''-th output. This function is zero if the constraint in {{EquationNote|1|(1)}} is satisfied, in other words, if <math>\mathbf{x}_i</math> lies on the correct side of the margin. For data on the wrong side of the margin, the function's value is proportional to the distance from the margin. The goal of the optimization then is to minimize: <math display="block"> \lVert \mathbf{w} \rVert^2 + C \left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right) \right],</math> where the parameter <math>C > 0</math> determines the trade-off between increasing the margin size and ensuring that the <math>\mathbf{x}_i</math> lie on the correct side of the margin (Note we can add a weight to either term in the equation above). By deconstructing the hinge loss, this optimization problem can be massaged into the following: <math display="block">\begin{align} &\underset{\mathbf{w},\;b,\;\mathbf{\zeta}}{\operatorname{minimize}} &&\|\mathbf{w}\|_2^2 + C\sum_{i=1}^n \zeta_i\\ &\text{subject to} && y_i(\mathbf{w}^\top \mathbf{x}_i - b) \geq 1 - \zeta_i, \quad \zeta_i \geq 0 \quad \forall i\in \{1,\dots,n\} \end{align}</math> Thus, for large values of <math>C</math>, it will behave similar to the hard-margin SVM, if the input data are linearly classifiable, but will still learn if a classification rule is viable or not. == Nonlinear Kernels == [[File:Kernel_Machine.svg|thumb|Kernel machine]] The original maximum-margin hyperplane algorithm proposed by Vapnik in 1963 constructed a [[linear classifier]]. However, in 1992, [[Bernhard Boser]], [[Isabelle Guyon]] and [[Vladimir Vapnik]] suggested a way to create nonlinear classifiers by applying the [[kernel trick]] (originally proposed by Aizerman et al.<ref>{{cite journal |last1=Aizerman |first1=Mark A. |last2=Braverman |first2=Emmanuel M. |last3=Rozonoer |first3=Lev I. |name-list-style=amp |year=1964 |title=Theoretical foundations of the potential function method in pattern recognition learning |journal=Automation and Remote Control |volume=25 |pages=821–837 }}</ref>) to maximum-margin hyperplanes.<ref name="ReferenceA" /> The kernel trick, where [[Dot product|dot products]] are replaced by kernels, is easily derived in the dual representation of the SVM problem. This allows the algorithm to fit the maximum-margin hyperplane in a transformed [[feature space]]. The transformation may be nonlinear and the transformed space high-dimensional; although the classifier is a hyperplane in the transformed feature space, it may be nonlinear in the original input space. It is noteworthy that working in a higher-dimensional feature space increases the [[generalization error]] of support vector machines, although given enough samples the algorithm still performs well.<ref>{{cite conference |last1=Jin |first1=Chi |last2=Wang |first2=Liwei |title=Dimensionality dependent PAC-Bayes margin bound |conference=Advances in Neural Information Processing Systems |year=2012 |url=http://papers.nips.cc/paper/4500-dimensionality-dependent-pac-bayes-margin-bound |url-status=live |archive-url=https://web.archive.org/web/20150402185336/http://papers.nips.cc/paper/4500-dimensionality-dependent-pac-bayes-margin-bound |archive-date=2015-04-02 |citeseerx=10.1.1.420.3487 }}</ref> Some common kernels include: * [[Homogeneous polynomial|Polynomial (homogeneous)]]: <math>k(\mathbf{x}_i, \mathbf{x}_j) = (\mathbf{x}_i \cdot \mathbf{x}_j)^d</math>. Particularly, when <math>d = 1</math>, this becomes the linear kernel. * [[Polynomial kernel|Polynomial]] (inhomogeneous): <math>k(\mathbf{x}_i, \mathbf{x}_j) = (\mathbf{x}_i \cdot \mathbf{x}_j + r)^d</math>. * Gaussian [[Radial basis function kernel|radial basis function]]: <math>k(\mathbf{x}_i, \mathbf{x}_j) = \exp\left(-\gamma \left\|\mathbf{x}_i - \mathbf{x}_j\right\|^2\right)</math> for <math>\gamma > 0</math>. Sometimes parametrized using <math>\gamma = 1/(2\sigma^2)</math>. * [[Sigmoid function]] ([[Hyperbolic tangent]]): <math>k(\mathbf{x_i}, \mathbf{x_j}) = \tanh(\kappa \mathbf{x}_i \cdot \mathbf{x}_j + c)</math> for some (not every) <math>\kappa > 0 </math> and <math>c < 0</math>. The kernel is related to the transform <math>\varphi(\mathbf{x}_i)</math> by the equation <math>k(\mathbf{x}_i, \mathbf{x}_j) = \varphi(\mathbf{x}_i) \cdot \varphi(\mathbf{x_j})</math>. The value {{math|'''w'''}} is also in the transformed space, with <math display="inline">\mathbf{w} = \sum_i \alpha_i y_i \varphi(\mathbf{x}_i)</math>. Dot products with {{math|'''w'''}} for classification can again be computed by the kernel trick, i.e. <math display="inline"> \mathbf{w} \cdot \varphi(\mathbf{x}) = \sum_i \alpha_i y_i k(\mathbf{x}_i, \mathbf{x})</math>. == Computing the SVM classifier == Computing the (soft-margin) SVM classifier amounts to minimizing an expression of the form {{NumBlk||<math display="block">\left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right) \right] + \lambda \|\mathbf{w}\|^2. </math>|{{EquationRef|2}}}} We focus on the soft-margin classifier since, as noted above, choosing a sufficiently small value for <math>\lambda</math> yields the hard-margin classifier for linearly classifiable input data. The classical approach, which involves reducing {{EquationNote|2|(2)}} to a [[quadratic programming]] problem, is detailed below. Then, more recent approaches such as sub-gradient descent and coordinate descent will be discussed. === Primal === Minimizing {{EquationNote|2|(2)}} can be rewritten as a constrained optimization problem with a differentiable objective function in the following way. For each <math>i \in \{1,\,\ldots,\,n\}</math> we introduce a variable <math> \zeta_i = \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right)</math>. Note that <math> \zeta_i</math> is the smallest nonnegative number satisfying <math> y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b) \geq 1 - \zeta_i.</math> Thus we can rewrite the optimization problem as follows <math display="block"> \begin{align} &\text{minimize } \frac 1 n \sum_{i=1}^n \zeta_i + \lambda \|\mathbf{w}\|^2 \\[0.5ex] &\text{subject to } y_i\left(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b\right) \geq 1 - \zeta_i \, \text{ and } \, \zeta_i \geq 0,\, \text{for all } i. \end{align} </math> This is called the ''primal'' problem. === Dual === By solving for the [[Duality (optimization)|Lagrangian dual]] of the above problem, one obtains the simplified problem <math display="block"> \begin{align} &\text{maximize}\,\, f(c_1 \ldots c_n) = \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_i c_i(\mathbf{x}_i^\mathsf{T} \mathbf{x}_j)y_j c_j, \\ &\text{subject to } \sum_{i=1}^n c_iy_i = 0,\,\text{and } 0 \leq c_i \leq \frac{1}{2n\lambda}\;\text{for all }i. \end{align}</math> This is called the ''dual'' problem. Since the dual maximization problem is a quadratic function of the <math> c_i</math> subject to linear constraints, it is efficiently solvable by [[quadratic programming]] algorithms. Here, the variables <math> c_i</math> are defined such that <math display="block"> \mathbf{w} = \sum_{i=1}^n c_iy_i \mathbf{x}_i.</math> Moreover, <math> c_i = 0</math> exactly when <math> \mathbf{x}_i</math> lies on the correct side of the margin, and <math> 0 < c_i <(2n\lambda)^{-1}</math> when <math> \mathbf{x}_i</math> lies on the margin's boundary. It follows that <math>\mathbf{w}</math> can be written as a linear combination of the support vectors. The offset, <math> b</math>, can be recovered by finding an <math> \mathbf{x}_i</math> on the margin's boundary and solving <math display="block"> y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b) = 1 \iff b = \mathbf{w}^\mathsf{T} \mathbf{x}_i - y_i .</math> (Note that <math>y_i^{-1}=y_i</math> since <math>y_i=\pm 1</math>.) === Kernel trick === {{Main|Kernel method}} [[Image:Kernel trick idea.svg|thumbnail|right|A training example of SVM with kernel given by φ((''a'', ''b'')) = (''a'', ''b'', ''a''<sup>2</sup> + ''b''<sup>2</sup>)]] Suppose now that we would like to learn a nonlinear classification rule which corresponds to a linear classification rule for the transformed data points <math> \varphi(\mathbf{x}_i).</math> Moreover, we are given a kernel function <math> k</math> which satisfies <math> k(\mathbf{x}_i, \mathbf{x}_j) = \varphi(\mathbf{x}_i) \cdot \varphi(\mathbf{x}_j)</math>. We know the classification vector <math>\mathbf{w}</math> in the transformed space satisfies <math display="block"> \mathbf{w} = \sum_{i=1}^n c_iy_i\varphi(\mathbf{x}_i),</math> where, the <math>c_i</math> are obtained by solving the optimization problem <math display="block"> \begin{align} \text{maximize}\,\, f(c_1 \ldots c_n) &= \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_ic_i(\varphi(\mathbf{x}_i) \cdot \varphi(\mathbf{x}_j))y_jc_j \\ &= \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_ic_ik(\mathbf{x}_i, \mathbf{x}_j)y_jc_j \\ \text{subject to } \sum_{i=1}^n c_i y_i &= 0,\,\text{and } 0 \leq c_i \leq \frac{1}{2n\lambda}\;\text{for all }i. \end{align} </math> The coefficients <math> c_i</math> can be solved for using quadratic programming, as before. Again, we can find some index <math> i</math> such that <math> 0 < c_i <(2n\lambda)^{-1}</math>, so that <math> \varphi(\mathbf{x}_i)</math> lies on the boundary of the margin in the transformed space, and then solve <math display="block"> \begin{align} b = \mathbf{w}^\mathsf{T} \varphi(\mathbf{x}_i) - y_i &= \left[\sum_{j=1}^n c_jy_j\varphi(\mathbf{x}_j) \cdot \varphi(\mathbf{x}_i)\right] - y_i \\ &= \left[\sum_{j=1}^n c_jy_jk(\mathbf{x}_j, \mathbf{x}_i)\right] - y_i. \end{align}</math> Finally, <math display="block"> \mathbf{z} \mapsto \sgn(\mathbf{w}^\mathsf{T} \varphi(\mathbf{z}) - b) = \sgn \left(\left[\sum_{i=1}^n c_iy_ik(\mathbf{x}_i, \mathbf{z})\right] - b\right).</math> === Modern methods === Recent algorithms for finding the SVM classifier include sub-gradient descent and coordinate descent. Both techniques have proven to offer significant advantages over the traditional approach when dealing with large, sparse datasets—sub-gradient methods are especially efficient when there are many training examples, and coordinate descent when the dimension of the feature space is high. ==== Sub-gradient descent ==== [[Subgradient method|Sub-gradient descent]] algorithms for the SVM work directly with the expression <math display="block">f(\mathbf{w}, b) = \left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right) \right] + \lambda \|\mathbf{w}\|^2.</math> Note that <math>f</math> is a [[convex function]] of <math>\mathbf{w}</math> and <math>b</math>. As such, traditional [[gradient descent]] (or [[Stochastic gradient descent|SGD]]) methods can be adapted, where instead of taking a step in the direction of the function's gradient, a step is taken in the direction of a vector selected from the function's [[Subderivative|sub-gradient]]. This approach has the advantage that, for certain implementations, the number of iterations does not scale with <math>n</math>, the number of data points.<ref>{{Cite journal |title=Pegasos: primal estimated sub-gradient solver for SVM |journal=Mathematical Programming |date=2010-10-16 |issn=0025-5610 |pages=3–30 |volume=127 |issue=1 |doi=10.1007/s10107-010-0420-4 |first1=Shai |last1=Shalev-Shwartz |first2=Yoram |last2=Singer |first3=Nathan |last3=Srebro |first4=Andrew |last4=Cotter |citeseerx=10.1.1.161.9629 |s2cid=53306004 }}</ref> ==== Coordinate descent ==== [[Coordinate descent]] algorithms for the SVM work from the dual problem <math display="block"> \begin{align} &\text{maximize}\,\, f(c_1 \ldots c_n) = \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_i c_i(x_i \cdot x_j)y_j c_j,\\ &\text{subject to } \sum_{i=1}^n c_iy_i = 0,\,\text{and } 0 \leq c_i \leq \frac{1}{2n\lambda}\;\text{for all }i. \end{align}</math> For each <math> i \in \{1,\, \ldots,\, n\}</math>, iteratively, the coefficient <math> c_i</math> is adjusted in the direction of <math> \partial f/ \partial c_i</math>. Then, the resulting vector of coefficients <math> (c_1',\,\ldots,\,c_n')</math> is projected onto the nearest vector of coefficients that satisfies the given constraints. (Typically Euclidean distances are used.) The process is then repeated until a near-optimal vector of coefficients is obtained. The resulting algorithm is extremely fast in practice, although few performance guarantees have been proven.<ref>{{Cite book |publisher=ACM |date=2008-01-01 |location=New York, NY, USA |isbn=978-1-60558-205-4 |pages=408–415 |doi=10.1145/1390156.1390208 |first1=Cho-Jui |last1=Hsieh |first2=Kai-Wei |last2=Chang |first3=Chih-Jen |last3=Lin |first4=S. Sathiya |last4=Keerthi |first5=S. |last5=Sundararajan |title=Proceedings of the 25th international conference on Machine learning - ICML '08 |chapter=A dual coordinate descent method for large-scale linear SVM |citeseerx=10.1.1.149.5594 |s2cid=7880266 }}</ref> == Empirical risk minimization == The soft-margin support vector machine described above is an example of an [[empirical risk minimization]] (ERM) algorithm for the ''[[hinge loss]]''. Seen this way, support vector machines belong to a natural class of algorithms for statistical inference, and many of its unique features are due to the behavior of the hinge loss. This perspective can provide further insight into how and why SVMs work, and allow us to better analyze their statistical properties. === Risk minimization === In supervised learning, one is given a set of training examples <math>X_1 \ldots X_n</math> with labels <math>y_1 \ldots y_n</math>, and wishes to predict <math>y_{n+1}</math> given <math>X_{n+1}</math>. To do so one forms a [[hypothesis]], <math>f</math>, such that <math>f(X_{n+1})</math> is a "good" approximation of <math>y_{n+1}</math>. A "good" approximation is usually defined with the help of a ''[[loss function]],'' <math>\ell(y,z)</math>, which characterizes how bad <math>z</math> is as a prediction of <math>y</math>. We would then like to choose a hypothesis that minimizes the ''[[Loss function#Expected loss|expected risk]]:'' <math display="block">\varepsilon(f) = \mathbb{E}\left[\ell(y_{n+1}, f(X_{n+1})) \right].</math> In most cases, we don't know the joint distribution of <math>X_{n+1},\,y_{n+1}</math> outright. In these cases, a common strategy is to choose the hypothesis that minimizes the ''empirical risk:'' <math display="block">\hat \varepsilon(f) = \frac 1 n \sum_{k=1}^n \ell(y_k, f(X_k)).</math> Under certain assumptions about the sequence of random variables <math>X_k,\, y_k</math> (for example, that they are generated by a finite Markov process), if the set of hypotheses being considered is small enough, the minimizer of the empirical risk will closely approximate the minimizer of the expected risk as <math>n</math> grows large. This approach is called ''empirical risk minimization,'' or ERM. === Regularization and stability === In order for the minimization problem to have a well-defined solution, we have to place constraints on the set <math>\mathcal{H}</math> of hypotheses being considered. If <math>\mathcal{H}</math> is a [[Normed vector space|normed space]] (as is the case for SVM), a particularly effective technique is to consider only those hypotheses <math> f</math> for which <math>\lVert f \rVert_{\mathcal H} < k</math> . This is equivalent to imposing a ''regularization penalty'' <math>\mathcal R(f) = \lambda_k\lVert f \rVert_{\mathcal H}</math>, and solving the new optimization problem <math display="block">\hat f = \mathrm{arg}\min_{f \in \mathcal{H}} \hat \varepsilon(f) + \mathcal{R}(f).</math> This approach is called ''[[Tikhonov regularization]].'' More generally, <math>\mathcal{R}(f)</math> can be some measure of the complexity of the hypothesis <math>f</math>, so that simpler hypotheses are preferred. === SVM and the hinge loss === Recall that the (soft-margin) SVM classifier <math>\hat\mathbf{w}, b: \mathbf{x} \mapsto \sgn(\hat\mathbf{w}^\mathsf{T} \mathbf{x} - b)</math> is chosen to minimize the following expression: <math display="block">\left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x} - b)\right) \right] + \lambda \|\mathbf{w}\|^2.</math> In light of the above discussion, we see that the SVM technique is equivalent to empirical risk minimization with Tikhonov regularization, where in this case the loss function is the [[hinge loss]] <math display="block">\ell(y,z) = \max\left(0, 1 - yz \right).</math> From this perspective, SVM is closely related to other fundamental [[Statistical classification#Linear classifiers|classification algorithm]]s such as [[regularized least-squares]] and [[logistic regression]]. The difference between the three lies in the choice of loss function: regularized least-squares amounts to empirical risk minimization with the [[Loss functions for classification|square-loss]], <math>\ell_{sq}(y,z) = (y-z)^2</math>; logistic regression employs the [[Loss functions for classification|log-loss]], <math display="block">\ell_{\log}(y,z) = \ln(1 + e^{-yz}).</math> ==== Target functions ==== The difference between the hinge loss and these other loss functions is best stated in terms of ''target functions -'' the function that minimizes expected risk for a given pair of random variables <math>X,\,y</math>. In particular, let <math>y_x</math> denote <math>y</math> conditional on the event that <math>X = x</math>. In the classification setting, we have: <math display="block">y_x = \begin{cases} 1 & \text{with probability } p_x \\ -1 & \text{with probability } 1-p_x \end{cases}</math> The optimal classifier is therefore: <math display="block">f^*(x) = \begin{cases}1 & \text{if }p_x \geq 1/2 \\ -1 & \text{otherwise}\end{cases} </math> For the square-loss, the target function is the conditional expectation function, <math>f_{sq}(x) = \mathbb{E}\left[y_x\right]</math>; For the logistic loss, it's the logit function, <math>f_{\log}(x) = \ln\left(p_x / ({1-p_x})\right)</math>. While both of these target functions yield the correct classifier, as <math>\sgn(f_{sq}) = \sgn(f_\log) = f^*</math>, they give us more information than we need. In fact, they give us enough information to completely describe the distribution of <math> y_x</math>. On the other hand, one can check that the target function for the hinge loss is ''exactly'' <math>f^*</math>. Thus, in a sufficiently rich hypothesis space—or equivalently, for an appropriately chosen kernel—the SVM classifier will converge to the simplest function (in terms of <math>\mathcal{R}</math>) that correctly classifies the data. This extends the geometric interpretation of SVM—for linear classification, the empirical risk is minimized by any function whose margins lie between the support vectors, and the simplest of these is the max-margin classifier.<ref>{{Cite journal |title=Are Loss Functions All the Same? |url=https://ieeexplore.ieee.org/document/6789841 |journal=Neural Computation |date=2004-05-01 |issn=0899-7667 |pages=1063–1076 |volume=16 |issue=5 |doi=10.1162/089976604773135104 |pmid=15070510 |first1=Lorenzo |last1=Rosasco |first2=Ernesto |last2=De Vito |first3=Andrea |last3=Caponnetto |first4=Michele |last4=Piana |first5=Alessandro |last5=Verri |citeseerx=10.1.1.109.6786 |s2cid=11845688 }}</ref> == Properties == SVMs belong to a family of generalized [[linear classifier]]s and can be interpreted as an extension of the [[perceptron]]. They can also be considered a special case of [[Tikhonov regularization]]. A special property is that they simultaneously minimize the empirical ''classification error'' and maximize the ''geometric margin''; hence they are also known as '''maximum [[margin classifier]]s'''. A comparison of the SVM to other classifiers has been made by Meyer, Leisch and Hornik.<ref>{{Cite journal |doi=10.1016/S0925-2312(03)00431-4 |title=The support vector machine under test |journal=Neurocomputing |volume=55 |issue=1–2 |pages=169–186 |date=September 2003 |last1=Meyer |first1=David |last2=Leisch |first2=Friedrich |last3=Hornik |first3=Kurt }}</ref> === Parameter selection === The effectiveness of SVM depends on the selection of kernel, the kernel's parameters, and soft margin parameter <math>\lambda</math>. A common choice is a Gaussian kernel, which has a single parameter ''<math>\gamma</math>''. The best combination of <math>\lambda</math> and <math>\gamma</math> is often selected by a [[grid search]] with exponentially growing sequences of <math>\lambda</math> and ''<math>\gamma</math>'', for example, <math>\lambda \in \{ 2^{-5}, 2^{-3}, \dots, 2^{13},2^{15} \}</math>; <math>\gamma \in \{ 2^{-15},2^{-13}, \dots, 2^{1},2^{3} \}</math>. Typically, each combination of parameter choices is checked using [[Cross-validation (statistics)|cross validation]], and the parameters with best cross-validation accuracy are picked. Alternatively, recent work in [[Bayesian optimization]] can be used to select <math>\lambda</math> and ''<math>\gamma</math>'' , often requiring the evaluation of far fewer parameter combinations than grid search. The final model, which is used for testing and for classifying new data, is then trained on the whole training set using the selected parameters.<ref>{{cite tech report |url=http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf |title=A Practical Guide to Support Vector Classification |last1=Hsu |first1=Chih-Wei |last2=Chang |first2=Chih-Chung |last3=Lin |first3=Chih-Jen |name-list-style=amp |year=2003 |institution=Department of Computer Science and Information Engineering, National Taiwan University |url-status=live |archive-url=https://web.archive.org/web/20130625201224/http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf |archive-date=2013-06-25 }}</ref> === Issues === Potential drawbacks of the SVM include the following aspects: * Requires full labeling of input data * Uncalibrated [[class membership probabilities]]—SVM stems from Vapnik's theory which avoids estimating probabilities on finite data * The SVM is only directly applicable for two-class tasks. Therefore, algorithms that reduce the multi-class task to several binary problems have to be applied; see the [[#Multiclass SVM|multi-class SVM]] section. * Parameters of a solved model are difficult to interpret. == Extensions == === Multiclass SVM === Multiclass SVM aims to assign labels to instances by using support vector machines, where the labels are drawn from a finite set of several elements. The dominant approach for doing so is to reduce the single [[multiclass problem]] into multiple [[binary classification]] problems.<ref name="duan2005">{{Cite book |last1=Duan |first1=Kai-Bo |last2=Keerthi |first2=S. Sathiya |chapter=Which Is the Best Multiclass SVM Method? An Empirical Study |doi=10.1007/11494683_28 |title=Multiple Classifier Systems |series=[[Lecture Notes in Computer Science|LNCS]] |volume=3541 |pages=278–285 |year=2005 |isbn=978-3-540-26306-7 |citeseerx=10.1.1.110.6789 |chapter-url=https://www.cs.iastate.edu/~honavar/multiclass-svm2.pdf |access-date=2019-07-18 |archive-date=2013-05-03 |archive-url=https://web.archive.org/web/20130503183745/http://www.cs.iastate.edu/~honavar/multiclass-svm2.pdf |url-status=dead }}</ref> Common methods for such reduction include:<ref name="duan2005" /><ref name="hsu2002">{{cite journal |title=A Comparison of Methods for Multiclass Support Vector Machines |year=2002 |journal=IEEE Transactions on Neural Networks |last1=Hsu |first1=Chih-Wei |last2=Lin |first2=Chih-Jen |volume=13 |issue=2 |pages=415–25 |name-list-style=amp |url=http://www.cs.iastate.edu/~honavar/multiclass-svm.pdf |pmid=18244442 |doi=10.1109/72.991427 |access-date=2018-01-08 |archive-date=2013-05-03 |archive-url=https://web.archive.org/web/20130503183743/http://www.cs.iastate.edu/~honavar/multiclass-svm.pdf |url-status=dead }}</ref> * Building binary classifiers that distinguish between one of the labels and the rest (''one-versus-all'') or between every pair of classes (''one-versus-one''). Classification of new instances for the one-versus-all case is done by a winner-takes-all strategy, in which the classifier with the highest-output function assigns the class (it is important that the output functions be calibrated to produce comparable scores). For the one-versus-one approach, classification is done by a max-wins voting strategy, in which every classifier assigns the instance to one of the two classes, then the vote for the assigned class is increased by one vote, and finally the class with the most votes determines the instance classification. * [[Directed acyclic graph]] SVM (DAGSVM)<ref>{{cite book |chapter=Large margin DAGs for multiclass classification |editor1=Solla, Sara A.|editor1-link=Sara Solla |editor2=Leen, Todd K. |editor3=Müller, Klaus-Robert |editor3-link=Klaus-Robert Müller |title=Advances in Neural Information Processing Systems |publisher=MIT Press |year=2000 |chapter-url=http://www.wisdom.weizmann.ac.il/~bagon/CVspring07/files/DAGSVM.pdf |pages=547–553 |last1=Platt |first1=John |author-link2=Nello Cristianini |last2=Cristianini |first2=Nello |author-link3=John Shawe-Taylor |last3=Shawe-Taylor |first3=John |url-status=live |archive-url=https://web.archive.org/web/20120616221540/http://www.wisdom.weizmann.ac.il/~bagon/CVspring07/files/DAGSVM.pdf |archive-date=2012-06-16 }}</ref> * [[Error correcting code|Error-correcting output codes]]<ref>{{cite journal |title=Solving Multiclass Learning Problems via Error-Correcting Output Codes |journal=Journal of Artificial Intelligence Research |year=1995 |url=http://www.jair.org/media/105/live-105-1426-jair.pdf |pages=263–286 |last1=Dietterich |first1=Thomas G. |last2=Bakiri |first2=Ghulum |bibcode=1995cs........1101D |arxiv=cs/9501101 |volume=2 |url-status=live |archive-url=https://web.archive.org/web/20130509061344/http://www.jair.org/media/105/live-105-1426-jair.pdf |archive-date=2013-05-09 |doi=10.1613/jair.105 |s2cid=47109072 }}</ref> Crammer and Singer proposed a multiclass SVM method which casts the [[multiclass classification]] problem into a single optimization problem, rather than decomposing it into multiple binary classification problems.<ref>{{cite journal |title=On the Algorithmic Implementation of Multiclass Kernel-based Vector Machines |year=2001 |url=http://jmlr.csail.mit.edu/papers/volume2/crammer01a/crammer01a.pdf |journal=Journal of Machine Learning Research |volume=2 |pages=265–292 |last1=Crammer |first1=Koby |last2=Singer |first2=Yoram |name-list-style=amp |url-status=live |archive-url=https://web.archive.org/web/20150829102651/http://jmlr.csail.mit.edu/papers/volume2/crammer01a/crammer01a.pdf |archive-date=2015-08-29 }}</ref> See also Lee, Lin and Wahba<ref>{{cite journal |title=Multicategory Support Vector Machines |year=2001 |journal=Computing Science and Statistics |volume=33 |url=http://www.interfacesymposia.org/I01/I2001Proceedings/YLee/YLee.pdf |last1=Lee |first1=Yoonkyung |last2=Lin |first2=Yi |last3=Wahba |first3=Grace |name-list-style=amp |url-status=live |archive-url=https://web.archive.org/web/20130617093314/http://www.interfacesymposia.org/I01/I2001Proceedings/YLee/YLee.pdf |archive-date=2013-06-17 }}</ref><ref>{{Cite journal |doi=10.1198/016214504000000098 |title=Multicategory Support Vector Machines |journal=Journal of the American Statistical Association |volume=99 |issue=465 |pages=67–81 |year=2004 |last1=Lee |first1=Yoonkyung |last2=Lin |first2=Yi |last3=Wahba |first3=Grace |citeseerx=10.1.1.22.1879 |s2cid=7066611 }}</ref> and Van den Burg and Groenen.<ref>{{Cite journal |title=GenSVM: A Generalized Multiclass Support Vector Machine |year=2016|url=http://jmlr.org/papers/volume17/14-526/14-526.pdf |journal=Journal of Machine Learning Research |volume=17|issue=224|pages=1–42|last1=Van den Burg|first1=Gerrit J. J. |last2=Groenen |first2=Patrick J. F.|name-list-style=amp}}</ref> === Transductive support vector machines === Transductive support vector machines extend SVMs in that they could also treat partially labeled data in [[semi-supervised learning]] by following the principles of [[Transduction (machine learning)|transduction]]. Here, in addition to the training set <math>\mathcal{D}</math>, the learner is also given a set <math display="block">\mathcal{D}^\star = \{ \mathbf{x}^\star_i \mid \mathbf{x}^\star_i \in \mathbb{R}^p\}_{i=1}^k </math> of test examples to be classified. Formally, a transductive support vector machine is defined by the following primal optimization problem:<ref>{{Cite conference |last=Joachims |first=Thorsten |title=Transductive Inference for Text Classification using Support Vector Machines |url=http://www1.cs.columbia.edu/~dplewis/candidacy/joachims99transductive.pdf |conference=Proceedings of the 1999 International Conference on Machine Learning (ICML 1999) |pages=200–209}}</ref> Minimize (in <math>\mathbf{w}, b, \mathbf{y}^\star</math>) <math display="block">\frac{1}{2}\|\mathbf{w}\|^2</math> subject to (for any <math>i = 1, \dots, n</math> and any <math>j = 1, \dots, k</math>) <math display="block">\begin{align} &y_i(\mathbf{w} \cdot \mathbf{x}_i - b) \ge 1, \\ &y^\star_j(\mathbf{w} \cdot \mathbf{x}^\star_j - b) \ge 1, \end{align}</math> and <math display="block">y^\star_j \in \{-1, 1\}.</math> Transductive support vector machines were introduced by Vladimir N. Vapnik in 1998. === Structured SVM === {{Main|structured SVM}} Structured support-vector machine is an extension of the traditional SVM model. While the SVM model is primarily designed for binary classification, multiclass classification, and regression tasks, structured SVM broadens its application to handle general structured output labels, for example parse trees, classification with taxonomies, sequence alignment and many more.<ref>https://www.cs.cornell.edu/people/tj/publications/tsochantaridis_etal_04a.pdf</ref> === Regression === [[Image:Svr epsilons demo.svg|thumbnail|right|Support vector regression (prediction) with different thresholds ''ε''. As ''ε'' increases, the prediction becomes less sensitive to errors.]] A version of SVM for [[regression analysis|regression]] was proposed in 1996 by [[Vladimir N. Vapnik]], Harris Drucker, Christopher J. C. Burges, Linda Kaufman and Alexander J. Smola.<ref>Drucker, Harris; Burges, Christ. C.; Kaufman, Linda; Smola, Alexander J.; and Vapnik, Vladimir N. (1997); "[http://papers.nips.cc/paper/1238-support-vector-regression-machines.pdf Support Vector Regression Machines]", in ''Advances in Neural Information Processing Systems 9, NIPS 1996'', 155–161, MIT Press.</ref> This method is called support vector regression (SVR). The model produced by support vector classification (as described above) depends only on a subset of the training data, because the cost function for building the model does not care about training points that lie beyond the margin. Analogously, the model produced by SVR depends only on a subset of the training data, because the cost function for building the model ignores any training data close to the model prediction. Another SVM version known as [[least-squares support vector machine]] (LS-SVM) has been proposed by Suykens and Vandewalle.<ref>Suykens, Johan A. K.; Vandewalle, Joos P. L.; "[https://lirias.kuleuven.be/bitstream/123456789/218716/2/Suykens_NeurProcLett.pdf Least squares support vector machine classifiers]", ''Neural Processing Letters'', vol. 9, no. 3, Jun. 1999, pp. 293–300.</ref> Training the original SVR means solving<ref>{{cite journal |last1=Smola |first1=Alex J. |first2=Bernhard |last2=Schölkopf |title=A tutorial on support vector regression |journal=Statistics and Computing |volume=14 |issue=3 |year=2004 |pages=199–222 |url=http://eprints.pascal-network.org/archive/00000856/01/fulltext.pdf |url-status=live |archive-url=https://web.archive.org/web/20120131193522/http://eprints.pascal-network.org/archive/00000856/01/fulltext.pdf |archive-date=2012-01-31 |doi=10.1023/B:STCO.0000035301.49549.88 |citeseerx=10.1.1.41.1452 |s2cid=15475 }}</ref> : minimize <math>\tfrac{1}{2} \|w\|^2 </math> : subject to <math> | y_i - \langle w, x_i \rangle - b | \le \varepsilon </math> where <math>x_i</math> is a training sample with target value <math>y_i</math>. The inner product plus intercept <math>\langle w, x_i \rangle + b</math> is the prediction for that sample, and <math>\varepsilon</math> is a free parameter that serves as a threshold: all predictions have to be within an <math>\varepsilon</math> range of the true predictions. Slack variables are usually added into the above to allow for errors and to allow approximation in the case the above problem is infeasible. === Bayesian SVM === In 2011 it was shown by Polson and Scott that the SVM admits a [[Bayesian probability|Bayesian]] interpretation through the technique of [[data augmentation]].<ref>{{cite journal |last1=Polson |first1=Nicholas G. |last2=Scott |first2=Steven L. |title=Data Augmentation for Support Vector Machines |journal=Bayesian Analysis |year=2011 |volume=6 |issue=1 |pages=1–23 |doi=10.1214/11-BA601 |doi-access=free }}</ref> In this approach the SVM is viewed as a [[graphical model]] (where the parameters are connected via probability distributions). This extended view allows the application of [[Bayesian probability|Bayesian]] techniques to SVMs, such as flexible feature modeling, automatic [[Hyperparameter (machine learning)|hyperparameter]] tuning, and [[Posterior predictive distribution|predictive uncertainty quantification]]. Recently, a scalable version of the Bayesian SVM was developed by [https://arxiv.org/search/stat?searchtype=author&query=Wenzel%2C+F Florian Wenzel], enabling the application of Bayesian SVMs to [[big data]].<ref>{{cite book |last1=Wenzel |first1=Florian |last2=Galy-Fajou |first2=Theo |last3=Deutsch |first3=Matthäus |last4=Kloft |first4=Marius |title=Machine Learning and Knowledge Discovery in Databases |chapter=Bayesian Nonlinear Support Vector Machines for Big Data |volume=10534 |pages=307–322 |year=2017 |arxiv=1707.05532 |bibcode=2017arXiv170705532W |doi=10.1007/978-3-319-71249-9_19 |series=Lecture Notes in Computer Science |isbn=978-3-319-71248-2 |s2cid=4018290 }}</ref> Florian Wenzel developed two different versions, a variational inference (VI) scheme for the Bayesian kernel support vector machine (SVM) and a stochastic version (SVI) for the linear Bayesian SVM.<ref>Florian Wenzel; Matthäus Deutsch; Théo Galy-Fajou; Marius Kloft; [http://approximateinference.org/accepted/WenzelEtAl2016.pdf ”Scalable Approximate Inference for the Bayesian Nonlinear Support Vector Machine”]</ref> == Implementation == The parameters of the maximum-margin hyperplane are derived by solving the optimization. There exist several specialized algorithms for quickly solving the [[quadratic programming]] (QP) problem that arises from SVMs, mostly relying on heuristics for breaking the problem down into smaller, more manageable chunks. Another approach is to use an [[interior-point method]] that uses [[Newton's method|Newton]]-like iterations to find a solution of the [[Karush–Kuhn–Tucker conditions]] of the primal and dual problems.<ref>{{Cite journal |doi=10.1137/S1052623400374379 |title=Interior-Point Methods for Massive Support Vector Machines |journal=SIAM Journal on Optimization |volume=13 |issue=3 |pages=783–804 |year=2002 |last1=Ferris |first1=Michael C. |last2=Munson |first2=Todd S. |url=http://www.cs.wisc.edu/~ferris/papers/siopt-svm.pdf |url-status=live |archive-url=https://web.archive.org/web/20081204224416/http://www.cs.wisc.edu/~ferris/papers/siopt-svm.pdf |archive-date=2008-12-04 |citeseerx=10.1.1.216.6893 |s2cid=13563302 }}</ref> Instead of solving a sequence of broken-down problems, this approach directly solves the problem altogether. To avoid solving a linear system involving the large kernel matrix, a low-rank approximation to the matrix is often used in the kernel trick. Another common method is Platt's [[sequential minimal optimization]] (SMO) algorithm, which breaks the problem down into 2-dimensional sub-problems that are solved analytically, eliminating the need for a numerical optimization algorithm and matrix storage. This algorithm is conceptually simple, easy to implement, generally faster, and has better scaling properties for difficult SVM problems.<ref>{{cite conference |first=John C. |last=Platt |title=Sequential Minimal Optimization: A Fast Algorithm for Training Support Vector Machines |conference=NIPS |year=1998 |url=http://research.microsoft.com/pubs/69644/tr-98-14.pdf |url-status=live |archive-url=https://web.archive.org/web/20150702075055/http://research.microsoft.com/pubs/69644/tr-98-14.pdf |archive-date=2015-07-02 }}</ref> The special case of linear support vector machines can be solved more efficiently by the same kind of algorithms used to optimize its close cousin, [[logistic regression]]; this class of algorithms includes [[Stochastic gradient descent|sub-gradient descent]] (e.g., PEGASOS<ref>{{cite conference |first1=Shai |last1=Shalev-Shwartz |first2=Yoram |last2=Singer |first3=Nathan |last3=Srebro |title=Pegasos: Primal Estimated sub-GrAdient SOlver for SVM |conference=ICML |year=2007 |url=http://ttic.uchicago.edu/~shai/papers/ShalevSiSr07.pdf |url-status=live |archive-url=https://web.archive.org/web/20131215051700/http://ttic.uchicago.edu/~shai/papers/ShalevSiSr07.pdf |archive-date=2013-12-15 }}</ref>) and [[coordinate descent]] (e.g., LIBLINEAR<ref>{{cite journal |first1=Rong-En |last1=Fan |first2=Kai-Wei |last2=Chang |first3=Cho-Jui |last3=Hsieh |first4=Xiang-Rui |last4=Wang |first5=Chih-Jen |last5=Lin |title=LIBLINEAR: A library for large linear classification |url=https://www.csie.ntu.edu.tw/~cjlin/papers/liblinear.pdf |journal=[[Journal of Machine Learning Research]] |volume=9 |pages=1871–1874 |year=2008 }}</ref>). LIBLINEAR has some attractive training-time properties. Each convergence iteration takes time linear in the time taken to read the train data, and the iterations also have a [[Rate of convergence|Q-linear convergence]] property, making the algorithm extremely fast. The general kernel SVMs can also be solved more efficiently using [[Stochastic gradient descent|sub-gradient descent]] (e.g. P-packSVM<ref>{{cite conference |first1=Zeyuan |last1=Allen Zhu |first2=Weizhu |last2=Chen |first3=Gang |last3=Wang |first4=Chenguang |last4=Zhu |first5=Zheng |last5=Chen |title=P-packSVM: Parallel Primal grAdient desCent Kernel SVM |conference=ICDM |year=2009 |url=http://people.csail.mit.edu/zeyuan/paper/2009-ICDM-Parallel.pdf |url-status=live |archive-url=https://web.archive.org/web/20140407095709/http://people.csail.mit.edu/zeyuan/paper/2009-ICDM-Parallel.pdf |archive-date=2014-04-07 }}</ref>), especially when [[parallelization]] is allowed. Kernel SVMs are available in many machine-learning toolkits, including [[LIBSVM]], [[MATLAB]], [http://support.sas.com/documentation/cdl/en/whatsnew/64209/HTML/default/viewer.htm#emdocwhatsnew71.htm SAS], SVMlight, [https://cran.r-project.org/package=kernlab kernlab], [[scikit-learn]], [[Shogun (toolbox)|Shogun]], [[Weka (machine learning)|Weka]], [http://image.diku.dk/shark/ Shark], [https://mloss.org/software/view/409/ JKernelMachines], [[OpenCV]] and others. Preprocessing of data (standardization) is highly recommended to enhance accuracy of classification.<ref> {{Cite journal| volume = 9| issue = Aug| pages = 1871–1874| last1 = Fan| first1 = Rong-En| last2 = Chang| first2 = Kai-Wei| last3 = Hsieh| first3 = Cho-Jui| last4 = Wang| first4 = Xiang-Rui| last5 = Lin| first5 = Chih-Jen| title = LIBLINEAR: A library for large linear classification| journal = Journal of Machine Learning Research| date = 2008}}</ref> There are a few methods of standardization, such as min-max, normalization by decimal scaling, Z-score.<ref>{{Cite journal| doi = 10.19026/rjaset.6.3638| volume = 6| pages = 3299–3303| last1 = Mohamad| first1 = Ismail| last2 = Usman| first2 = Dauda| title = Standardization and Its Effects on K-Means Clustering Algorithm| journal = Research Journal of Applied Sciences, Engineering and Technology| date = 2013-09-01| issue = 17| doi-access = free}}</ref> Subtraction of mean and division by variance of each feature is usually used for SVM.<ref>{{Cite journal| doi = 10.1140/epjds/s13688-019-0201-0| volume = 8| last1 = Fennell| first1 = Peter| last2 = Zuo| first2 = Zhiya| last3 = Lerman| first3 = Kristina|author3-link=Kristina Lerman| title = Predicting and explaining behavioral data with structured feature space decomposition| journal = EPJ Data Science| date = 2019-12-01| doi-access = free| arxiv = 1810.09841}}</ref> == See also == * [[In situ adaptive tabulation]] * [[Kernel machines]] * [[Fisher kernel]] * [[Platt scaling]] * [[Polynomial kernel]] * [[Predictive analytics]] * [[Regularization perspectives on support vector machines]] * [[Relevance vector machine]], a probabilistic sparse-kernel model identical in functional form to SVM * [[Sequential minimal optimization]] * [[Space mapping]] * [[Winnow (algorithm)]] == References == {{Reflist|30em}} == Further reading == *{{cite journal |last1=Bennett |first1=Kristin P. |last2=Campbell |first2=Colin |url=http://kdd.org/exploration_files/bennett.pdf |title=Support Vector Machines: Hype or Hallelujah? |journal=SIGKDD Explorations |volume=2 |issue=2 |year=2000 |pages=1–13 |doi=10.1145/380995.380999|s2cid=207753020 }} *{{cite book |last1=Cristianini |first1=Nello |last2=Shawe-Taylor |first2=John |title=An Introduction to Support Vector Machines and other kernel-based learning methods |publisher=Cambridge University Press |year=2000 |isbn=0-521-78019-5 }} *{{cite book |last1=Fradkin |first1=Dmitriy |last2=Muchnik |first2=Ilya |chapter-url=http://paul.rutgers.edu/~dfradkin/papers/svm.pdf |chapter=Support Vector Machines for Classification |editor-last=Abello |editor-first=J. |editor2-last=Carmode |editor2-first=G. |title=Discrete Methods in Epidemiology |series=DIMACS Series in Discrete Mathematics and Theoretical Computer Science |volume=70 |pages=13–20 |year=2006 }}{{Citation not found|date=June 2022}} * {{cite book |last1=Joachims |first1=Thorsten |chapter=Text categorization with Support Vector Machines: Learning with many relevant features |date=1998 |publisher=Springer |location=Berlin, Heidelberg |page=137-142 |title="Machine Learning: ECML-98 |series=Lecture Notes in Computer Science |volume=1398 |editor1-last=Nédellec |editor1-first=Claire |editor2-last=Rouveirol |editor2-first=Céline |doi=10.1007/BFb0026683|isbn=978-3-540-64417-0 |s2cid=2427083 }} *{{cite journal |last=Ivanciuc |first=Ovidiu |url=http://www.ivanciuc.org/Files/Reprint/Ivanciuc_SVM_CCR_2007_23_291.pdf |title=Applications of Support Vector Machines in Chemistry |journal=Reviews in Computational Chemistry |volume=23 |year=2007 |pages=291–400 |doi=10.1002/9780470116449.ch6 |isbn=9780470116449 }} *{{cite book |first1=Gareth |last1=James |first2=Daniela |last2=Witten |first3=Trevor |last3=Hastie |first4=Robert |last4=Tibshirani |title=An Introduction to Statistical Learning : with Applications in R |location=New York |publisher=Springer |year=2013 |isbn=978-1-4614-7137-0 |chapter=Support Vector Machines |pages=337–372 |chapter-url=http://www-bcf.usc.edu/~gareth/ISL/ISLR%20Seventh%20Printing.pdf#page=345 }} *{{cite book |last1=Schölkopf |first1=Bernhard |last2=Smola |first2=Alexander J. |title=Learning with Kernels |publisher=MIT Press |location=Cambridge, MA |year=2002 |isbn=0-262-19475-9 }} *{{cite book |last1=Steinwart |first1=Ingo |last2=Christmann |first2=Andreas |title=Support Vector Machines |publisher=Springer |location=New York |year=2008 |isbn=978-0-387-77241-7 }} *{{cite book |last1=Theodoridis |first1=Sergios |last2=Koutroumbas |first2=Konstantinos |title=Pattern Recognition |edition=4th |publisher=Academic Press |year=2009 |isbn=978-1-59749-272-0 }} == External links == * [http://www.csie.ntu.edu.tw/~cjlin/libsvm/ libsvm], [[LIBSVM]] is a popular library of SVM learners * [http://www.csie.ntu.edu.tw/~cjlin/liblinear/ liblinear] is a library for large linear classification including some SVMs * [http://svmlight.joachims.org SVM light] is a collection of software tools for learning and classification using SVM * [http://cs.stanford.edu/people/karpathy/svmjs/demo/ SVMJS live demo] {{Webarchive|url=https://web.archive.org/web/20130505185215/http://cs.stanford.edu/people/karpathy/svmjs/demo/ |date=2013-05-05 }} is a GUI demo for [[JavaScript]] implementation of SVMs {{Authority control}} {{DEFAULTSORT:Support Vector Machine}} [[Category:Support vector machines| ]] [[Category:Classification algorithms]] [[Category:Statistical classification]]'
New page wikitext, after the edit ($1) (new_wikitext)
'{{short description|Set of methods for supervised statistical learning}} {{Machine learning|Supervised learning}} In [[machine learning]], '''support vector machines''' ('''SVMs''', also '''support vector networks'''<ref name="CorinnaCortes" />) are [[supervised learning|supervised]] [[Maximum-margin hyperplane|max-margin]] models with associated learning [[algorithm]]s that analyze data for [[Statistical classification|classification]] and [[regression analysis]]. Developed at [[AT&T Bell Laboratories]] by [[Vladimir Vapnik]] with colleagues (Boser et al., 1992, [[Isabelle Guyon|Guyon]] et al., 1993, [[Corinna Cortes|Cortes]] and [[Vladimir Vapnik|Vapnik]], 1995,<ref name="CorinnaCortes" /> Vapnik et al., 1997<ref>{{Cite journal |last=Vapnik |first=Vladimir N. |date=1997 |editor-last=Gerstner |editor-first=Wulfram |editor2-last=Germond |editor2-first=Alain |editor3-last=Hasler |editor3-first=Martin |editor4-last=Nicoud |editor4-first=Jean-Daniel |title=The Support Vector method |url=https://link.springer.com/chapter/10.1007/BFb0020166 |journal=Artificial Neural Networks — ICANN'97 |language=en |location=Berlin, Heidelberg |publisher=Springer |pages=261–271 |doi=10.1007/BFb0020166 |isbn=978-3-540-69620-9}}</ref>) SVMs are one of the most studied models, being based on statistical learning frameworks of [[VC theory]] proposed by Vapnik (1982, 1995) and [[Alexey Chervonenkis|Chervonenkis]] (1974). In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], which represent the data only through a set of pairwise similarity comparisons between the original data observations and representing the data by these transformed coordinates in the higher dimensional feature space. Thus, SVMs use the kernel trick to implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive. The support vector clustering<ref name="HavaSiegelmann">{{cite journal |last1=Ben-Hur |first1=Asa |last2=Horn |first2=David |last3=Siegelmann |first3=Hava |last4=Vapnik |first4=Vladimir N. |title="Support vector clustering" (2001); |journal=Journal of Machine Learning Research |volume=2 |pages=125–137}}</ref> algorithm, created by [[Hava Siegelmann]] and [[Vladimir Vapnik]], applies the statistics of support vectors, developed in the support vector machines algorithm, to categorize unlabeled data.{{Citation needed|date=March 2018}} These data sets require [[unsupervised learning]] approaches, which attempt to find natural [[Cluster analysis|clustering of the data]] to groups and, then, to map new data according to these clusters. The popularity of SVMs is likely due to their amenability to theoretical analysis, their flexibility in being applied to a wide variety of tasks, including [[Structured prediction|structured prediction problems]]. It is not clear that SVMs have better predictive performance than other linear models, such as [[logistic regression]] and [[linear regression]].{{Citation needed|date=December 2023}} == Motivation == [[Image:Svm separating hyperplanes (SVG).svg|thumb|right|H<sub>1</sub> does not separate the classes. H<sub>2</sub> does, but only with a small margin. H<sub>3</sub> separates them with the maximal margin.]] [[Statistical classification|Classifying data]] is a common task in [[machine learning]]. Suppose some given data points each belong to one of two classes, and the goal is to decide which class a ''new'' [[data point]] will be in. In the case of support vector machines, a data point is viewed as a <math>p</math>-dimensional vector (a list of <math>p</math> numbers), and we want to know whether we can separate such points with a <math>(p-1)</math>-dimensional [[hyperplane]]. This is called a [[linear classifier]]. There are many hyperplanes that might classify the data. One reasonable choice as the best hyperplane is the one that represents the largest separation, or [[Margin (machine learning)|margin]], between the two classes. So we choose the hyperplane so that the distance from it to the nearest data point on each side is maximized. If such a hyperplane exists, it is known as the ''[[maximum-margin hyperplane]]'' and the linear classifier it defines is known as a ''maximum-[[margin classifier]]''; or equivalently, the ''[[Perceptron#Convergence|perceptron of optimal stability]]''.{{Citation needed|date=June 2013}} More formally, a support vector machine constructs a [[hyperplane]] or set of hyperplanes in a high or infinite-dimensional space, which can be used for [[Statistical classification|classification]], [[Regression analysis|regression]], or other tasks like outliers detection.<ref>{{cite web |url=http://scikit-learn.org/stable/modules/svm.html |title=1.4. Support Vector Machines — scikit-learn 0.20.2 documentation |access-date=2017-11-08 |url-status=live |archive-url=https://web.archive.org/web/20171108151644/http://scikit-learn.org/stable/modules/svm.html |archive-date=2017-11-08 }}</ref> Intuitively, a good separation is achieved by the hyperplane that has the largest distance to the nearest training-data point of any class (so-called functional margin), since in general the larger the margin, the lower the [[generalization error]] of the classifier.<ref>{{cite book |first1=Trevor |last1=Hastie |author-link=Trevor Hastie |first2=Robert |last2=Tibshirani |author-link2=Robert Tibshirani |first3=Jerome |last3=Friedman |author-link3=Jerome H. Friedman |title=The Elements of Statistical Learning : Data Mining, Inference, and Prediction |location=New York |publisher=Springer |edition=Second |year=2008 |page=134 |url=https://web.stanford.edu/~hastie/Papers/ESLII.pdf#page=153 }}</ref> A lower [[generalization error]] means that the implementer is less likely to experience [[overfitting]]. [[File:Kernel_Machine.svg|thumb|Kernel machine]] Whereas the original problem may be stated in a finite-dimensional space, it often happens that the sets to discriminate are not [[Linear separability|linearly separable]] in that space. For this reason, it was proposed<ref name="ReferenceA" /> that the original finite-dimensional space be mapped into a much higher-dimensional space, presumably making the separation easier in that space. To keep the computational load reasonable, the mappings used by SVM schemes are designed to ensure that [[dot product]]s of pairs of input data vectors may be computed easily in terms of the variables in the original space, by defining them in terms of a [[Positive-definite kernel|kernel function]] <math>k(x, y)</math> selected to suit the problem.<ref>{{Cite book |last1=Press |first1=William H. |last2=Teukolsky |first2=Saul A. |last3=Vetterling |first3=William T. |last4=Flannery |first4=Brian P. |year=2007 |title=Numerical Recipes: The Art of Scientific Computing |edition=3rd |publisher=Cambridge University Press |location=New York |isbn=978-0-521-88068-8 |chapter=Section 16.5. Support Vector Machines |chapter-url=http://apps.nrbook.com/empanel/index.html#pg=883 |url-status=live |archive-url=https://web.archive.org/web/20110811154417/http://apps.nrbook.com/empanel/index.html#pg=883 |archive-date=2011-08-11 }} </ref> The hyperplanes in the higher-dimensional space are defined as the set of points whose dot product with a vector in that space is constant, where such a set of vectors is an orthogonal (and thus minimal) set of vectors that defines a hyperplane. The vectors defining the hyperplanes can be chosen to be linear combinations with parameters <math>\alpha_i</math> of images of [[feature vector]]s <math>x_i</math> that occur in the data base. With this choice of a hyperplane, the points <math>x</math> in the [[feature space]] that are mapped into the hyperplane are defined by the relation <math>\textstyle\sum_i \alpha_i k(x_i, x) = \text{constant}.</math> Note that if <math>k(x, y)</math> becomes small as <math>y</math> grows further away from <math>x</math>, each term in the sum measures the degree of closeness of the test point <math>x</math> to the corresponding data base point <math>x_i</math>. In this way, the sum of kernels above can be used to measure the relative nearness of each test point to the data points originating in one or the other of the sets to be discriminated. Note the fact that the set of points <math>x</math> mapped into any hyperplane can be quite convoluted as a result, allowing much more complex discrimination between sets that are not convex at all in the original space. == Applications == SVMs can be used to solve various real-world problems: * SVMs are helpful in [[Text categorization|text and hypertext categorization]], as their application can significantly reduce the need for labeled training instances in both the standard inductive and [[Transduction (machine learning)|transductive]] settings.<ref>{{cite book |last1=Joachims |first1=Thorsten |title=Machine Learning: ECML-98 |chapter=Text categorization with Support Vector Machines: Learning with many relevant features |volume=1398 |date=1998 |pages=137–142 |doi=10.1007/BFb0026683 |isbn=978-3-540-64417-0 |publisher=Springer |language=en|series=Lecture Notes in Computer Science |doi-access=free }}</ref> Some methods for [[shallow semantic parsing]] are based on support vector machines.<ref>{{Cite conference |last=Pradhan |first=Sameer S. |display-authors=et al. |date=2 May 2004 |title=Shallow Semantic Parsing using Support Vector Machines |url=http://www.aclweb.org/anthology/N04-1030 |conference=Proceedings of the Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics: HLT-NAACL 2004 |publisher=Association for Computational Linguistics |pages=233–240}}</ref> * [[Image classification|Classification of images]] can also be performed using SVMs. Experimental results show that SVMs achieve significantly higher search accuracy than traditional query refinement schemes after just three to four rounds of relevance feedback. This is also true for [[image segmentation]] systems, including those using a modified version SVM that uses the privileged approach as suggested by Vapnik.<ref>Vapnik, Vladimir N.: Invited Speaker. IPMU Information Processing and Management 2014).</ref><ref>{{cite book | chapter-url=https://pdfs.semanticscholar.org/917f/15d33d32062bffeb6401eee9fe71d16d6a84.pdf | s2cid=4154772 | doi=10.1007/978-3-319-16829-6_12 | chapter=Spatial-Taxon Information Granules as Used in Iterative Fuzzy-Decision-Making for Image Segmentation | title=Granular Computing and Decision-Making | series=Studies in Big Data | year=2015 | last1=Barghout | first1=Lauren | volume=10 | pages=285–318 | isbn=978-3-319-16828-9 | access-date=2018-01-08 | archive-date=2018-01-08 | archive-url=https://web.archive.org/web/20180108120422/https://pdfs.semanticscholar.org/917f/15d33d32062bffeb6401eee9fe71d16d6a84.pdf | url-status=dead }}</ref> * Classification of satellite data like [[Synthetic-aperture radar|SAR]] data using supervised SVM.<ref>{{cite arXiv |author=A. Maity |title=Supervised Classification of RADARSAT-2 Polarimetric Data for Different Land Features|year=2016|eprint=1608.00501|class=cs.CV}}</ref> * Hand-written characters can be [[Handwriting recognition|recognized]] using SVM.<ref>{{Cite journal |last=DeCoste |first=Dennis |date=2002 |title=Training Invariant Support Vector Machines |url=https://people.eecs.berkeley.edu/~malik/cs294/decoste-scholkopf.pdf |journal=Machine Learning |volume=46 |pages=161–190 |doi=10.1023/A:1012454411458 |s2cid=85843 |doi-access=free }}</ref><ref>{{Cite book|last1=Maitra|first1=D. S.|last2=Bhattacharya|first2=U.|last3=Parui|first3=S. K.|title=2015 13th International Conference on Document Analysis and Recognition (ICDAR) |chapter=CNN based common approach to handwritten character recognition of multiple scripts |date=August 2015|chapter-url=https://ieeexplore.ieee.org/document/7333916|pages=1021–1025|doi=10.1109/ICDAR.2015.7333916|isbn=978-1-4799-1805-8|s2cid=25739012}}</ref> * The SVM algorithm has been widely applied in the biological and other sciences. They have been used to classify proteins with up to 90% of the compounds classified correctly. [[Permutation test]]s based on SVM weights have been suggested as a mechanism for interpretation of SVM models.<ref>{{cite journal | pmc=3767485 | year=2013 | last1=Gaonkar | first1=B. | last2=Davatzikos | first2=C. | title=Analytic estimation of statistical significance maps for support vector machine based multi-variate image analysis and classification | journal=NeuroImage | volume=78 | pages=270–283 | doi=10.1016/j.neuroimage.2013.03.066 | pmid=23583748 }}</ref><ref>{{Cite journal |url=http://www.aramislab.fr/perso/colliot/files/media2011_remi_published.pdf |url-status=dead |doi=10.1016/j.media.2011.05.007 |title=Spatial regularization of SVM for the detection of diffusion alterations associated with stroke outcome |year=2011 |last1=Cuingnet |first1=Rémi |last2=Rosso |first2=Charlotte |last3=Chupin |first3=Marie |last4=Lehéricy |first4=Stéphane |last5=Dormont |first5=Didier |last6=Benali |first6=Habib |last7=Samson |first7=Yves |last8=Colliot |first8=Olivier |journal=Medical Image Analysis |volume=15 |issue=5 |pages=729–737 |pmid=21752695 |access-date=2018-01-08 |archive-date=2018-12-22 |archive-url=https://web.archive.org/web/20181222172844/http://www.aramislab.fr/perso/colliot/files/media2011_remi_published.pdf }}</ref> Support vector machine weights have also been used to interpret SVM models in the past.<ref>Statnikov, Alexander; Hardin, Douglas; & Aliferis, Constantin; (2006); [http://www.ccdlab.org/paper-pdfs/NIPS_2006.pdf "Using SVM weight-based methods to identify causally relevant and non-causally relevant variables"], ''Sign'', 1, 4.</ref> Posthoc interpretation of support vector machine models in order to identify features used by the model to make predictions is a relatively new area of research with special significance in the biological sciences. == History == The original SVM algorithm was invented by [[Vladimir N. Vapnik]] and [[Alexey Chervonenkis|Alexey Ya. Chervonenkis]] in 1964.{{Citation needed|date=March 2022}} In 1992, Bernhard Boser, [[Isabelle Guyon]] and [[Vladimir Vapnik]] suggested a way to create nonlinear classifiers by applying the [[kernel trick]] to maximum-margin hyperplanes.<ref name="ReferenceA">{{Cite book |doi=10.1145/130385.130401 |chapter=A training algorithm for optimal margin classifiers |title=Proceedings of the fifth annual workshop on Computational learning theory – COLT '92 |pages=144 |year=1992 |last1=Boser |first1=Bernhard E. |last2=Guyon |first2=Isabelle M. |last3=Vapnik |first3=Vladimir N. |isbn=978-0897914970 |citeseerx=10.1.1.21.3818 |s2cid=207165665 |chapter-url=http://www.clopinet.com/isabelle/Papers/colt92.ps.Z }}</ref> The "soft margin" incarnation, as is commonly used in software packages, was proposed by [[Corinna Cortes]] and Vapnik in 1993 and published in 1995.<ref name="CorinnaCortes">{{Cite journal |last1=Cortes |first1=Corinna |author-link1=Corinna Cortes |last2=Vapnik |first2=Vladimir |author-link2=Vladimir Vapnik |year=1995 |title=Support-vector networks |journal=[[Machine Learning (journal)|Machine Learning]] |volume=20 |issue=3 |pages=273–297 |doi=10.1007/BF00994018 |doi-access=free |citeseerx=10.1.1.15.9362 |s2cid=206787478 |url=http://image.diku.dk/imagecanon/material/cortes_vapnik95.pdf }}</ref> == Linear SVM == [[File:SVM margin.png|thumb|Maximum-margin hyperplane and margins for an SVM trained with samples from two classes. Samples on the margin are called the support vectors.|alt=|300x300px]] We are given a training dataset of <math>n</math> points of the form <math display="block"> (\mathbf{x}_1, y_1), \ldots, (\mathbf{x}_n, y_n),</math> where the <math>y_i</math> are either 1 or −1, each indicating the class to which the point <math>\mathbf{x}_i </math> belongs. Each <math>\mathbf{x}_i </math> is a <math>p</math>-dimensional [[Real number|real]] vector. We want to find the "maximum-margin hyperplane" that divides the group of points <math>\mathbf{x}_i</math> for which <math>y_i = 1</math> from the group of points for which <math>y_i = -1</math>, which is defined so that the distance between the hyperplane and the nearest point <math>\mathbf{x}_i </math> from either group is maximized. Any [[hyperplane]] can be written as the set of points <math>\mathbf{x}</math> satisfying <math display="block">\mathbf{w}^\mathsf{T} \mathbf{x} - b = 0,</math> where <math>\mathbf{w}</math> is the (not necessarily normalized) [[Normal (geometry)|normal vector]] to the hyperplane. This is much like [[Hesse normal form]], except that <math>\mathbf{w}</math> is not necessarily a unit vector. The parameter <math>\tfrac{b}{\|\mathbf{w}\|}</math> determines the offset of the hyperplane from the origin along the normal vector <math>\mathbf{w}</math>. === Hard-margin === If the training data is [[linearly separable]], we can select two parallel hyperplanes that separate the two classes of data, so that the distance between them is as large as possible. The region bounded by these two hyperplanes is called the "margin", and the maximum-margin hyperplane is the hyperplane that lies halfway between them. With a normalized or standardized dataset, these hyperplanes can be described by the equations : <math>\mathbf{w}^\mathsf{T} \mathbf{x} - b = 1</math> (anything on or above this boundary is of one class, with label 1) and : <math>\mathbf{w}^\mathsf{T} \mathbf{x} - b = -1</math> (anything on or below this boundary is of the other class, with label −1). Geometrically, the distance between these two hyperplanes is <math>\tfrac{2}{\|\mathbf{w}\|}</math>,<ref>{{cite web |url=https://math.stackexchange.com/q/1305925/168764 |title=Why is the SVM margin equal to <math>\frac{2}{\|\mathbf{w}\|}</math> |author= |date=30 May 2015 |website=Mathematics Stack Exchange}}</ref> so to maximize the distance between the planes we want to minimize <math>\|\mathbf{w}\|</math>. The distance is computed using the [[distance from a point to a plane]] equation. We also have to prevent data points from falling into the margin, we add the following constraint: for each <math>i</math> either <math display="block">\mathbf{w}^\mathsf{T} \mathbf{x}_i - b \ge 1 \, , \text{ if } y_i = 1,</math> or <math display="block">\mathbf{w}^\mathsf{T} \mathbf{x}_i - b \le -1 \, , \text{ if } y_i = -1.</math> These constraints state that each data point must lie on the correct side of the margin. This can be rewritten as {{NumBlk||<math display="block">y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b) \ge 1, \quad \text{ for all } 1 \le i \le n.</math>|{{EquationRef|1}}}} We can put this together to get the optimization problem: <math>\begin{align} &\underset{\mathbf{w},\;b}{\operatorname{minimize}} && \|\mathbf{w}\|_2^2\\ &\text{subject to} && y_i(\mathbf{w}^\top \mathbf{x}_i - b) \geq 1 \quad \forall i \in \{1,\dots,n\} \end{align}</math> The <math>\mathbf{w}</math> and <math>b</math> that solve this problem determine the final classifier, <math>\mathbf{x} \mapsto \sgn(\mathbf{w}^\mathsf{T} \mathbf{x} - b)</math>, where <math>\sgn(\cdot)</math> is the [[sign function]]. An important consequence of this geometric description is that the max-margin hyperplane is completely determined by those <math>\mathbf{x}_i</math> that lie nearest to it (explained below). These <math>\mathbf{x}_i</math> are called ''support vectors''. === Soft-margin === To extend SVM to cases in which the data are not linearly separable, the ''[[hinge loss]]'' function is helpful <math display="block">\max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right).</math> Note that <math>y_i</math> is the ''i''-th target (i.e., in this case, 1 or −1), and <math>\mathbf{w}^\mathsf{T} \mathbf{x}_i - b</math> is the ''i''-th output. This function is zero if the constraint in {{EquationNote|1|(1)}} is satisfied, in other words, if <math>\mathbf{x}_i</math> lies on the correct side of the margin. For data on the wrong side of the margin, the function's value is proportional to the distance from the margin. The goal of the optimization then is to minimize: <math display="block"> \lVert \mathbf{w} \rVert^2 + C \left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right) \right],</math> where the parameter <math>C > 0</math> determines the trade-off between increasing the margin size and ensuring that the <math>\mathbf{x}_i</math> lie on the correct side of the margin (Note we can add a weight to either term in the equation above). By deconstructing the hinge loss, this optimization problem can be massaged into the following: <math display="block">\begin{align} &\underset{\mathbf{w},\;b,\;\mathbf{\zeta}}{\operatorname{minimize}} &&\|\mathbf{w}\|_2^2 + C\sum_{i=1}^n \zeta_i\\ &\text{subject to} && y_i(\mathbf{w}^\top \mathbf{x}_i - b) \geq 1 - \zeta_i, \quad \zeta_i \geq 0 \quad \forall i\in \{1,\dots,n\} \end{align}</math> Thus, for large values of <math>C</math>, it will behave similar to the hard-margin SVM, if the input data are linearly classifiable, but will still learn if a classification rule is viable or not. == Nonlinear Kernels == [[File:Kernel_Machine.svg|thumb|Kernel machine]] The original maximum-margin hyperplane algorithm proposed by Vapnik in 1963 constructed a [[linear classifier]]. However, in 1992, [[Bernhard Boser]], [[Isabelle Guyon]] and [[Vladimir Vapnik]] suggested a way to create nonlinear classifiers by applying the [[kernel trick]] (originally proposed by Aizerman et al.<ref>{{cite journal |last1=Aizerman |first1=Mark A. |last2=Braverman |first2=Emmanuel M. |last3=Rozonoer |first3=Lev I. |name-list-style=amp |year=1964 |title=Theoretical foundations of the potential function method in pattern recognition learning |journal=Automation and Remote Control |volume=25 |pages=821–837 }}</ref>) to maximum-margin hyperplanes.<ref name="ReferenceA" /> The kernel trick, where [[Dot product|dot products]] are replaced by kernels, is easily derived in the dual representation of the SVM problem. This allows the algorithm to fit the maximum-margin hyperplane in a transformed [[feature space]]. The transformation may be nonlinear and the transformed space high-dimensional; although the classifier is a hyperplane in the transformed feature space, it may be nonlinear in the original input space. It is noteworthy that working in a higher-dimensional feature space increases the [[generalization error]] of support vector machines, although given enough samples the algorithm still performs well.<ref>{{cite conference |last1=Jin |first1=Chi |last2=Wang |first2=Liwei |title=Dimensionality dependent PAC-Bayes margin bound |conference=Advances in Neural Information Processing Systems |year=2012 |url=http://papers.nips.cc/paper/4500-dimensionality-dependent-pac-bayes-margin-bound |url-status=live |archive-url=https://web.archive.org/web/20150402185336/http://papers.nips.cc/paper/4500-dimensionality-dependent-pac-bayes-margin-bound |archive-date=2015-04-02 |citeseerx=10.1.1.420.3487 }}</ref> Some common kernels include: * [[Homogeneous polynomial|Polynomial (homogeneous)]]: <math>k(\mathbf{x}_i, \mathbf{x}_j) = (\mathbf{x}_i \cdot \mathbf{x}_j)^d</math>. Particularly, when <math>d = 1</math>, this becomes the linear kernel. * [[Polynomial kernel|Polynomial]] (inhomogeneous): <math>k(\mathbf{x}_i, \mathbf{x}_j) = (\mathbf{x}_i \cdot \mathbf{x}_j + r)^d</math>. * Gaussian [[Radial basis function kernel|radial basis function]]: <math>k(\mathbf{x}_i, \mathbf{x}_j) = \exp\left(-\gamma \left\|\mathbf{x}_i - \mathbf{x}_j\right\|^2\right)</math> for <math>\gamma > 0</math>. Sometimes parametrized using <math>\gamma = 1/(2\sigma^2)</math>. * [[Sigmoid function]] ([[Hyperbolic tangent]]): <math>k(\mathbf{x_i}, \mathbf{x_j}) = \tanh(\kappa \mathbf{x}_i \cdot \mathbf{x}_j + c)</math> for some (not every) <math>\kappa > 0 </math> and <math>c < 0</math>. The kernel is related to the transform <math>\varphi(\mathbf{x}_i)</math> by the equation <math>k(\mathbf{x}_i, \mathbf{x}_j) = \varphi(\mathbf{x}_i) \cdot \varphi(\mathbf{x_j})</math>. The value {{math|'''w'''}} is also in the transformed space, with <math display="inline">\mathbf{w} = \sum_i \alpha_i y_i \varphi(\mathbf{x}_i)</math>. Dot products with {{math|'''w'''}} for classification can again be computed by the kernel trick, i.e. <math display="inline"> \mathbf{w} \cdot \varphi(\mathbf{x}) = \sum_i \alpha_i y_i k(\mathbf{x}_i, \mathbf{x})</math>. == Computing the SVM classifier == Computing the (soft-margin) SVM classifier amounts to minimizing an expression of the form {{NumBlk||<math display="block">\left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right) \right] + \lambda \|\mathbf{w}\|^2. </math>|{{EquationRef|2}}}} We focus on the soft-margin classifier since, as noted above, choosing a sufficiently small value for <math>\lambda</math> yields the hard-margin classifier for linearly classifiable input data. The classical approach, which involves reducing {{EquationNote|2|(2)}} to a [[quadratic programming]] problem, is detailed below. Then, more recent approaches such as sub-gradient descent and coordinate descent will be discussed. === Primal === Minimizing {{EquationNote|2|(2)}} can be rewritten as a constrained optimization problem with a differentiable objective function in the following way. For each <math>i \in \{1,\,\ldots,\,n\}</math> we introduce a variable <math> \zeta_i = \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right)</math>. Note that <math> \zeta_i</math> is the smallest nonnegative number satisfying <math> y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b) \geq 1 - \zeta_i.</math> Thus we can rewrite the optimization problem as follows <math display="block"> \begin{align} &\text{minimize } \frac 1 n \sum_{i=1}^n \zeta_i + \lambda \|\mathbf{w}\|^2 \\[0.5ex] &\text{subject to } y_i\left(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b\right) \geq 1 - \zeta_i \, \text{ and } \, \zeta_i \geq 0,\, \text{for all } i. \end{align} </math> This is called the ''primal'' problem. === Dual === By solving for the [[Duality (optimization)|Lagrangian dual]] of the above problem, one obtains the simplified problem <math display="block"> \begin{align} &\text{maximize}\,\, f(c_1 \ldots c_n) = \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_i c_i(\mathbf{x}_i^\mathsf{T} \mathbf{x}_j)y_j c_j, \\ &\text{subject to } \sum_{i=1}^n c_iy_i = 0,\,\text{and } 0 \leq c_i \leq \frac{1}{2n\lambda}\;\text{for all }i. \end{align}</math> This is called the ''dual'' problem. Since the dual maximization problem is a quadratic function of the <math> c_i</math> subject to linear constraints, it is efficiently solvable by [[quadratic programming]] algorithms. Here, the variables <math> c_i</math> are defined such that <math display="block"> \mathbf{w} = \sum_{i=1}^n c_iy_i \mathbf{x}_i.</math> Moreover, <math> c_i = 0</math> exactly when <math> \mathbf{x}_i</math> lies on the correct side of the margin, and <math> 0 < c_i <(2n\lambda)^{-1}</math> when <math> \mathbf{x}_i</math> lies on the margin's boundary. It follows that <math>\mathbf{w}</math> can be written as a linear combination of the support vectors. The offset, <math> b</math>, can be recovered by finding an <math> \mathbf{x}_i</math> on the margin's boundary and solving <math display="block"> y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b) = 1 \iff b = \mathbf{w}^\mathsf{T} \mathbf{x}_i - y_i .</math> (Note that <math>y_i^{-1}=y_i</math> since <math>y_i=\pm 1</math>.) === Kernel trick === {{Main|Kernel method}} [[Image:Kernel trick idea.svg|thumbnail|right|A training example of SVM with kernel given by φ((''a'', ''b'')) = (''a'', ''b'', ''a''<sup>2</sup> + ''b''<sup>2</sup>)]] Suppose now that we would like to learn a nonlinear classification rule which corresponds to a linear classification rule for the transformed data points <math> \varphi(\mathbf{x}_i).</math> Moreover, we are given a kernel function <math> k</math> which satisfies <math> k(\mathbf{x}_i, \mathbf{x}_j) = \varphi(\mathbf{x}_i) \cdot \varphi(\mathbf{x}_j)</math>. We know the classification vector <math>\mathbf{w}</math> in the transformed space satisfies <math display="block"> \mathbf{w} = \sum_{i=1}^n c_iy_i\varphi(\mathbf{x}_i),</math> where, the <math>c_i</math> are obtained by solving the optimization problem <math display="block"> \begin{align} \text{maximize}\,\, f(c_1 \ldots c_n) &= \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_ic_i(\varphi(\mathbf{x}_i) \cdot \varphi(\mathbf{x}_j))y_jc_j \\ &= \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_ic_ik(\mathbf{x}_i, \mathbf{x}_j)y_jc_j \\ \text{subject to } \sum_{i=1}^n c_i y_i &= 0,\,\text{and } 0 \leq c_i \leq \frac{1}{2n\lambda}\;\text{for all }i. \end{align} </math> The coefficients <math> c_i</math> can be solved for using quadratic programming, as before. Again, we can find some index <math> i</math> such that <math> 0 < c_i <(2n\lambda)^{-1}</math>, so that <math> \varphi(\mathbf{x}_i)</math> lies on the boundary of the margin in the transformed space, and then solve <math display="block"> \begin{align} b = \mathbf{w}^\mathsf{T} \varphi(\mathbf{x}_i) - y_i &= \left[\sum_{j=1}^n c_jy_j\varphi(\mathbf{x}_j) \cdot \varphi(\mathbf{x}_i)\right] - y_i \\ &= \left[\sum_{j=1}^n c_jy_jk(\mathbf{x}_j, \mathbf{x}_i)\right] - y_i. \end{align}</math> Finally, <math display="block"> \mathbf{z} \mapsto \sgn(\mathbf{w}^\mathsf{T} \varphi(\mathbf{z}) - b) = \sgn \left(\left[\sum_{i=1}^n c_iy_ik(\mathbf{x}_i, \mathbf{z})\right] - b\right).</math> === Modern methods === Recent algorithms for finding the SVM classifier include sub-gradient descent and coordinate descent. Both techniques have proven to offer significant advantages over the traditional approach when dealing with large, sparse datasets—sub-gradient methods are especially efficient when there are many training examples, and coordinate descent when the dimension of the feature space is high. ==== Sub-gradient descent ==== [[Subgradient method|Sub-gradient descent]] algorithms for the SVM work directly with the expression <math display="block">f(\mathbf{w}, b) = \left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x}_i - b)\right) \right] + \lambda \|\mathbf{w}\|^2.</math> Note that <math>f</math> is a [[convex function]] of <math>\mathbf{w}</math> and <math>b</math>. As such, traditional [[gradient descent]] (or [[Stochastic gradient descent|SGD]]) methods can be adapted, where instead of taking a step in the direction of the function's gradient, a step is taken in the direction of a vector selected from the function's [[Subderivative|sub-gradient]]. This approach has the advantage that, for certain implementations, the number of iterations does not scale with <math>n</math>, the number of data points.<ref>{{Cite journal |title=Pegasos: primal estimated sub-gradient solver for SVM |journal=Mathematical Programming |date=2010-10-16 |issn=0025-5610 |pages=3–30 |volume=127 |issue=1 |doi=10.1007/s10107-010-0420-4 |first1=Shai |last1=Shalev-Shwartz |first2=Yoram |last2=Singer |first3=Nathan |last3=Srebro |first4=Andrew |last4=Cotter |citeseerx=10.1.1.161.9629 |s2cid=53306004 }}</ref> ==== Coordinate descent ==== [[Coordinate descent]] algorithms for the SVM work from the dual problem <math display="block"> \begin{align} &\text{maximize}\,\, f(c_1 \ldots c_n) = \sum_{i=1}^n c_i - \frac 1 2 \sum_{i=1}^n\sum_{j=1}^n y_i c_i(x_i \cdot x_j)y_j c_j,\\ &\text{subject to } \sum_{i=1}^n c_iy_i = 0,\,\text{and } 0 \leq c_i \leq \frac{1}{2n\lambda}\;\text{for all }i. \end{align}</math> For each <math> i \in \{1,\, \ldots,\, n\}</math>, iteratively, the coefficient <math> c_i</math> is adjusted in the direction of <math> \partial f/ \partial c_i</math>. Then, the resulting vector of coefficients <math> (c_1',\,\ldots,\,c_n')</math> is projected onto the nearest vector of coefficients that satisfies the given constraints. (Typically Euclidean distances are used.) The process is then repeated until a near-optimal vector of coefficients is obtained. The resulting algorithm is extremely fast in practice, although few performance guarantees have been proven.<ref>{{Cite book |publisher=ACM |date=2008-01-01 |location=New York, NY, USA |isbn=978-1-60558-205-4 |pages=408–415 |doi=10.1145/1390156.1390208 |first1=Cho-Jui |last1=Hsieh |first2=Kai-Wei |last2=Chang |first3=Chih-Jen |last3=Lin |first4=S. Sathiya |last4=Keerthi |first5=S. |last5=Sundararajan |title=Proceedings of the 25th international conference on Machine learning - ICML '08 |chapter=A dual coordinate descent method for large-scale linear SVM |citeseerx=10.1.1.149.5594 |s2cid=7880266 }}</ref> == Empirical risk minimization == The soft-margin support vector machine described above is an example of an [[empirical risk minimization]] (ERM) algorithm for the ''[[hinge loss]]''. Seen this way, support vector machines belong to a natural class of algorithms for statistical inference, and many of its unique features are due to the behavior of the hinge loss. This perspective can provide further insight into how and why SVMs work, and allow us to better analyze their statistical properties. === Risk minimization === In supervised learning, one is given a set of training examples <math>X_1 \ldots X_n</math> with labels <math>y_1 \ldots y_n</math>, and wishes to predict <math>y_{n+1}</math> given <math>X_{n+1}</math>. To do so one forms a [[hypothesis]], <math>f</math>, such that <math>f(X_{n+1})</math> is a "good" approximation of <math>y_{n+1}</math>. A "good" approximation is usually defined with the help of a ''[[loss function]],'' <math>\ell(y,z)</math>, which characterizes how bad <math>z</math> is as a prediction of <math>y</math>. We would then like to choose a hypothesis that minimizes the ''[[Loss function#Expected loss|expected risk]]:'' <math display="block">\varepsilon(f) = \mathbb{E}\left[\ell(y_{n+1}, f(X_{n+1})) \right].</math> In most cases, we don't know the joint distribution of <math>X_{n+1},\,y_{n+1}</math> outright. In these cases, a common strategy is to choose the hypothesis that minimizes the ''empirical risk:'' <math display="block">\hat \varepsilon(f) = \frac 1 n \sum_{k=1}^n \ell(y_k, f(X_k)).</math> Under certain assumptions about the sequence of random variables <math>X_k,\, y_k</math> (for example, that they are generated by a finite Markov process), if the set of hypotheses being considered is small enough, the minimizer of the empirical risk will closely approximate the minimizer of the expected risk as <math>n</math> grows large. This approach is called ''empirical risk minimization,'' or ERM. === Regularization and stability === In order for the minimization problem to have a well-defined solution, we have to place constraints on the set <math>\mathcal{H}</math> of hypotheses being considered. If <math>\mathcal{H}</math> is a [[Normed vector space|normed space]] (as is the case for SVM), a particularly effective technique is to consider only those hypotheses <math> f</math> for which <math>\lVert f \rVert_{\mathcal H} < k</math> . This is equivalent to imposing a ''regularization penalty'' <math>\mathcal R(f) = \lambda_k\lVert f \rVert_{\mathcal H}</math>, and solving the new optimization problem <math display="block">\hat f = \mathrm{arg}\min_{f \in \mathcal{H}} \hat \varepsilon(f) + \mathcal{R}(f).</math> This approach is called ''[[Tikhonov regularization]].'' More generally, <math>\mathcal{R}(f)</math> can be some measure of the complexity of the hypothesis <math>f</math>, so that simpler hypotheses are preferred. === SVM and the hinge loss === Recall that the (soft-margin) SVM classifier <math>\hat\mathbf{w}, b: \mathbf{x} \mapsto \sgn(\hat\mathbf{w}^\mathsf{T} \mathbf{x} - b)</math> is chosen to minimize the following expression: <math display="block">\left[\frac 1 n \sum_{i=1}^n \max\left(0, 1 - y_i(\mathbf{w}^\mathsf{T} \mathbf{x} - b)\right) \right] + \lambda \|\mathbf{w}\|^2.</math> In light of the above discussion, we see that the SVM technique is equivalent to empirical risk minimization with Tikhonov regularization, where in this case the loss function is the [[hinge loss]] <math display="block">\ell(y,z) = \max\left(0, 1 - yz \right).</math> From this perspective, SVM is closely related to other fundamental [[Statistical classification#Linear classifiers|classification algorithm]]s such as [[regularized least-squares]] and [[logistic regression]]. The difference between the three lies in the choice of loss function: regularized least-squares amounts to empirical risk minimization with the [[Loss functions for classification|square-loss]], <math>\ell_{sq}(y,z) = (y-z)^2</math>; logistic regression employs the [[Loss functions for classification|log-loss]], <math display="block">\ell_{\log}(y,z) = \ln(1 + e^{-yz}).</math> ==== Target functions ==== The difference between the hinge loss and these other loss functions is best stated in terms of ''target functions -'' the function that minimizes expected risk for a given pair of random variables <math>X,\,y</math>. In particular, let <math>y_x</math> denote <math>y</math> conditional on the event that <math>X = x</math>. In the classification setting, we have: <math display="block">y_x = \begin{cases} 1 & \text{with probability } p_x \\ -1 & \text{with probability } 1-p_x \end{cases}</math> The optimal classifier is therefore: <math display="block">f^*(x) = \begin{cases}1 & \text{if }p_x \geq 1/2 \\ -1 & \text{otherwise}\end{cases} </math> For the square-loss, the target function is the conditional expectation function, <math>f_{sq}(x) = \mathbb{E}\left[y_x\right]</math>; For the logistic loss, it's the logit function, <math>f_{\log}(x) = \ln\left(p_x / ({1-p_x})\right)</math>. While both of these target functions yield the correct classifier, as <math>\sgn(f_{sq}) = \sgn(f_\log) = f^*</math>, they give us more information than we need. In fact, they give us enough information to completely describe the distribution of <math> y_x</math>. On the other hand, one can check that the target function for the hinge loss is ''exactly'' <math>f^*</math>. Thus, in a sufficiently rich hypothesis space—or equivalently, for an appropriately chosen kernel—the SVM classifier will converge to the simplest function (in terms of <math>\mathcal{R}</math>) that correctly classifies the data. This extends the geometric interpretation of SVM—for linear classification, the empirical risk is minimized by any function whose margins lie between the support vectors, and the simplest of these is the max-margin classifier.<ref>{{Cite journal |title=Are Loss Functions All the Same? |url=https://ieeexplore.ieee.org/document/6789841 |journal=Neural Computation |date=2004-05-01 |issn=0899-7667 |pages=1063–1076 |volume=16 |issue=5 |doi=10.1162/089976604773135104 |pmid=15070510 |first1=Lorenzo |last1=Rosasco |first2=Ernesto |last2=De Vito |first3=Andrea |last3=Caponnetto |first4=Michele |last4=Piana |first5=Alessandro |last5=Verri |citeseerx=10.1.1.109.6786 |s2cid=11845688 }}</ref> == Properties == SVMs belong to a family of generalized [[linear classifier]]s and can be interpreted as an extension of the [[perceptron]]. They can also be considered a special case of [[Tikhonov regularization]]. A special property is that they simultaneously minimize the empirical ''classification error'' and maximize the ''geometric margin''; hence they are also known as '''maximum [[margin classifier]]s'''. A comparison of the SVM to other classifiers has been made by Meyer, Leisch and Hornik.<ref>{{Cite journal |doi=10.1016/S0925-2312(03)00431-4 |title=The support vector machine under test |journal=Neurocomputing |volume=55 |issue=1–2 |pages=169–186 |date=September 2003 |last1=Meyer |first1=David |last2=Leisch |first2=Friedrich |last3=Hornik |first3=Kurt }}</ref> === Parameter selection === The effectiveness of SVM depends on the selection of kernel, the kernel's parameters, and soft margin parameter <math>\lambda</math>. A common choice is a Gaussian kernel, which has a single parameter ''<math>\gamma</math>''. The best combination of <math>\lambda</math> and <math>\gamma</math> is often selected by a [[grid search]] with exponentially growing sequences of <math>\lambda</math> and ''<math>\gamma</math>'', for example, <math>\lambda \in \{ 2^{-5}, 2^{-3}, \dots, 2^{13},2^{15} \}</math>; <math>\gamma \in \{ 2^{-15},2^{-13}, \dots, 2^{1},2^{3} \}</math>. Typically, each combination of parameter choices is checked using [[Cross-validation (statistics)|cross validation]], and the parameters with best cross-validation accuracy are picked. Alternatively, recent work in [[Bayesian optimization]] can be used to select <math>\lambda</math> and ''<math>\gamma</math>'' , often requiring the evaluation of far fewer parameter combinations than grid search. The final model, which is used for testing and for classifying new data, is then trained on the whole training set using the selected parameters.<ref>{{cite tech report |url=http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf |title=A Practical Guide to Support Vector Classification |last1=Hsu |first1=Chih-Wei |last2=Chang |first2=Chih-Chung |last3=Lin |first3=Chih-Jen |name-list-style=amp |year=2003 |institution=Department of Computer Science and Information Engineering, National Taiwan University |url-status=live |archive-url=https://web.archive.org/web/20130625201224/http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf |archive-date=2013-06-25 }}</ref> === Issues === Potential drawbacks of the SVM include the following aspects: * Requires full labeling of input data * Uncalibrated [[class membership probabilities]]—SVM stems from Vapnik's theory which avoids estimating probabilities on finite data * The SVM is only directly applicable for two-class tasks. Therefore, algorithms that reduce the multi-class task to several binary problems have to be applied; see the [[#Multiclass SVM|multi-class SVM]] section. * Parameters of a solved model are difficult to interpret. == Extensions == === Multiclass SVM === Multiclass SVM aims to assign labels to instances by using support vector machines, where the labels are drawn from a finite set of several elements. The dominant approach for doing so is to reduce the single [[multiclass problem]] into multiple [[binary classification]] problems.<ref name="duan2005">{{Cite book |last1=Duan |first1=Kai-Bo |last2=Keerthi |first2=S. Sathiya |chapter=Which Is the Best Multiclass SVM Method? An Empirical Study |doi=10.1007/11494683_28 |title=Multiple Classifier Systems |series=[[Lecture Notes in Computer Science|LNCS]] |volume=3541 |pages=278–285 |year=2005 |isbn=978-3-540-26306-7 |citeseerx=10.1.1.110.6789 |chapter-url=https://www.cs.iastate.edu/~honavar/multiclass-svm2.pdf |access-date=2019-07-18 |archive-date=2013-05-03 |archive-url=https://web.archive.org/web/20130503183745/http://www.cs.iastate.edu/~honavar/multiclass-svm2.pdf |url-status=dead }}</ref> Common methods for such reduction include:<ref name="duan2005" /><ref name="hsu2002">{{cite journal |title=A Comparison of Methods for Multiclass Support Vector Machines |year=2002 |journal=IEEE Transactions on Neural Networks |last1=Hsu |first1=Chih-Wei |last2=Lin |first2=Chih-Jen |volume=13 |issue=2 |pages=415–25 |name-list-style=amp |url=http://www.cs.iastate.edu/~honavar/multiclass-svm.pdf |pmid=18244442 |doi=10.1109/72.991427 |access-date=2018-01-08 |archive-date=2013-05-03 |archive-url=https://web.archive.org/web/20130503183743/http://www.cs.iastate.edu/~honavar/multiclass-svm.pdf |url-status=dead }}</ref> * Building binary classifiers that distinguish between one of the labels and the rest (''one-versus-all'') or between every pair of classes (''one-versus-one''). Classification of new instances for the one-versus-all case is done by a winner-takes-all strategy, in which the classifier with the highest-output function assigns the class (it is important that the output functions be calibrated to produce comparable scores). For the one-versus-one approach, classification is done by a max-wins voting strategy, in which every classifier assigns the instance to one of the two classes, then the vote for the assigned class is increased by one vote, and finally the class with the most votes determines the instance classification. * [[Directed acyclic graph]] SVM (DAGSVM)<ref>{{cite book |chapter=Large margin DAGs for multiclass classification |editor1=Solla, Sara A.|editor1-link=Sara Solla |editor2=Leen, Todd K. |editor3=Müller, Klaus-Robert |editor3-link=Klaus-Robert Müller |title=Advances in Neural Information Processing Systems |publisher=MIT Press |year=2000 |chapter-url=http://www.wisdom.weizmann.ac.il/~bagon/CVspring07/files/DAGSVM.pdf |pages=547–553 |last1=Platt |first1=John |author-link2=Nello Cristianini |last2=Cristianini |first2=Nello |author-link3=John Shawe-Taylor |last3=Shawe-Taylor |first3=John |url-status=live |archive-url=https://web.archive.org/web/20120616221540/http://www.wisdom.weizmann.ac.il/~bagon/CVspring07/files/DAGSVM.pdf |archive-date=2012-06-16 }}</ref> * [[Error correcting code|Error-correcting output codes]]<ref>{{cite journal |title=Solving Multiclass Learning Problems via Error-Correcting Output Codes |journal=Journal of Artificial Intelligence Research |year=1995 |url=http://www.jair.org/media/105/live-105-1426-jair.pdf |pages=263–286 |last1=Dietterich |first1=Thomas G. |last2=Bakiri |first2=Ghulum |bibcode=1995cs........1101D |arxiv=cs/9501101 |volume=2 |url-status=live |archive-url=https://web.archive.org/web/20130509061344/http://www.jair.org/media/105/live-105-1426-jair.pdf |archive-date=2013-05-09 |doi=10.1613/jair.105 |s2cid=47109072 }}</ref> Crammer and Singer proposed a multiclass SVM method which casts the [[multiclass classification]] problem into a single optimization problem, rather than decomposing it into multiple binary classification problems.<ref>{{cite journal |title=On the Algorithmic Implementation of Multiclass Kernel-based Vector Machines |year=2001 |url=http://jmlr.csail.mit.edu/papers/volume2/crammer01a/crammer01a.pdf |journal=Journal of Machine Learning Research |volume=2 |pages=265–292 |last1=Crammer |first1=Koby |last2=Singer |first2=Yoram |name-list-style=amp |url-status=live |archive-url=https://web.archive.org/web/20150829102651/http://jmlr.csail.mit.edu/papers/volume2/crammer01a/crammer01a.pdf |archive-date=2015-08-29 }}</ref> See also Lee, Lin and Wahba<ref>{{cite journal |title=Multicategory Support Vector Machines |year=2001 |journal=Computing Science and Statistics |volume=33 |url=http://www.interfacesymposia.org/I01/I2001Proceedings/YLee/YLee.pdf |last1=Lee |first1=Yoonkyung |last2=Lin |first2=Yi |last3=Wahba |first3=Grace |name-list-style=amp |url-status=live |archive-url=https://web.archive.org/web/20130617093314/http://www.interfacesymposia.org/I01/I2001Proceedings/YLee/YLee.pdf |archive-date=2013-06-17 }}</ref><ref>{{Cite journal |doi=10.1198/016214504000000098 |title=Multicategory Support Vector Machines |journal=Journal of the American Statistical Association |volume=99 |issue=465 |pages=67–81 |year=2004 |last1=Lee |first1=Yoonkyung |last2=Lin |first2=Yi |last3=Wahba |first3=Grace |citeseerx=10.1.1.22.1879 |s2cid=7066611 }}</ref> and Van den Burg and Groenen.<ref>{{Cite journal |title=GenSVM: A Generalized Multiclass Support Vector Machine |year=2016|url=http://jmlr.org/papers/volume17/14-526/14-526.pdf |journal=Journal of Machine Learning Research |volume=17|issue=224|pages=1–42|last1=Van den Burg|first1=Gerrit J. J. |last2=Groenen |first2=Patrick J. F.|name-list-style=amp}}</ref> === Transductive support vector machines === Transductive support vector machines extend SVMs in that they could also treat partially labeled data in [[semi-supervised learning]] by following the principles of [[Transduction (machine learning)|transduction]]. Here, in addition to the training set <math>\mathcal{D}</math>, the learner is also given a set <math display="block">\mathcal{D}^\star = \{ \mathbf{x}^\star_i \mid \mathbf{x}^\star_i \in \mathbb{R}^p\}_{i=1}^k </math> of test examples to be classified. Formally, a transductive support vector machine is defined by the following primal optimization problem:<ref>{{Cite conference |last=Joachims |first=Thorsten |title=Transductive Inference for Text Classification using Support Vector Machines |url=http://www1.cs.columbia.edu/~dplewis/candidacy/joachims99transductive.pdf |conference=Proceedings of the 1999 International Conference on Machine Learning (ICML 1999) |pages=200–209}}</ref> Minimize (in <math>\mathbf{w}, b, \mathbf{y}^\star</math>) <math display="block">\frac{1}{2}\|\mathbf{w}\|^2</math> subject to (for any <math>i = 1, \dots, n</math> and any <math>j = 1, \dots, k</math>) <math display="block">\begin{align} &y_i(\mathbf{w} \cdot \mathbf{x}_i - b) \ge 1, \\ &y^\star_j(\mathbf{w} \cdot \mathbf{x}^\star_j - b) \ge 1, \end{align}</math> and <math display="block">y^\star_j \in \{-1, 1\}.</math> Transductive support vector machines were introduced by Vladimir N. Vapnik in 1998. === Structured SVM === {{Main|structured SVM}} Structured support-vector machine is an extension of the traditional SVM model. While the SVM model is primarily designed for binary classification, multiclass classification, and regression tasks, structured SVM broadens its application to handle general structured output labels, for example parse trees, classification with taxonomies, sequence alignment and many more.<ref>https://www.cs.cornell.edu/people/tj/publications/tsochantaridis_etal_04a.pdf</ref> === Regression === [[Image:Svr epsilons demo.svg|thumbnail|right|Support vector regression (prediction) with different thresholds ''ε''. As ''ε'' increases, the prediction becomes less sensitive to errors.]] A version of SVM for [[regression analysis|regression]] was proposed in 1996 by [[Vladimir N. Vapnik]], Harris Drucker, Christopher J. C. Burges, Linda Kaufman and Alexander J. Smola.<ref>Drucker, Harris; Burges, Christ. C.; Kaufman, Linda; Smola, Alexander J.; and Vapnik, Vladimir N. (1997); "[http://papers.nips.cc/paper/1238-support-vector-regression-machines.pdf Support Vector Regression Machines]", in ''Advances in Neural Information Processing Systems 9, NIPS 1996'', 155–161, MIT Press.</ref> This method is called support vector regression (SVR). The model produced by support vector classification (as described above) depends only on a subset of the training data, because the cost function for building the model does not care about training points that lie beyond the margin. Analogously, the model produced by SVR depends only on a subset of the training data, because the cost function for building the model ignores any training data close to the model prediction. Another SVM version known as [[least-squares support vector machine]] (LS-SVM) has been proposed by Suykens and Vandewalle.<ref>Suykens, Johan A. K.; Vandewalle, Joos P. L.; "[https://lirias.kuleuven.be/bitstream/123456789/218716/2/Suykens_NeurProcLett.pdf Least squares support vector machine classifiers]", ''Neural Processing Letters'', vol. 9, no. 3, Jun. 1999, pp. 293–300.</ref> Training the original SVR means solving<ref>{{cite journal |last1=Smola |first1=Alex J. |first2=Bernhard |last2=Schölkopf |title=A tutorial on support vector regression |journal=Statistics and Computing |volume=14 |issue=3 |year=2004 |pages=199–222 |url=http://eprints.pascal-network.org/archive/00000856/01/fulltext.pdf |url-status=live |archive-url=https://web.archive.org/web/20120131193522/http://eprints.pascal-network.org/archive/00000856/01/fulltext.pdf |archive-date=2012-01-31 |doi=10.1023/B:STCO.0000035301.49549.88 |citeseerx=10.1.1.41.1452 |s2cid=15475 }}</ref> : minimize <math>\tfrac{1}{2} \|w\|^2 </math> : subject to <math> | y_i - \langle w, x_i \rangle - b | \le \varepsilon </math> where <math>x_i</math> is a training sample with target value <math>y_i</math>. The inner product plus intercept <math>\langle w, x_i \rangle + b</math> is the prediction for that sample, and <math>\varepsilon</math> is a free parameter that serves as a threshold: all predictions have to be within an <math>\varepsilon</math> range of the true predictions. Slack variables are usually added into the above to allow for errors and to allow approximation in the case the above problem is infeasible. === Bayesian SVM === In 2011 it was shown by Polson and Scott that the SVM admits a [[Bayesian probability|Bayesian]] interpretation through the technique of [[data augmentation]].<ref>{{cite journal |last1=Polson |first1=Nicholas G. |last2=Scott |first2=Steven L. |title=Data Augmentation for Support Vector Machines |journal=Bayesian Analysis |year=2011 |volume=6 |issue=1 |pages=1–23 |doi=10.1214/11-BA601 |doi-access=free }}</ref> In this approach the SVM is viewed as a [[graphical model]] (where the parameters are connected via probability distributions). This extended view allows the application of [[Bayesian probability|Bayesian]] techniques to SVMs, such as flexible feature modeling, automatic [[Hyperparameter (machine learning)|hyperparameter]] tuning, and [[Posterior predictive distribution|predictive uncertainty quantification]]. Recently, a scalable version of the Bayesian SVM was developed by [https://arxiv.org/search/stat?searchtype=author&query=Wenzel%2C+F Florian Wenzel], enabling the application of Bayesian SVMs to [[big data]].<ref>{{cite book |last1=Wenzel |first1=Florian |last2=Galy-Fajou |first2=Theo |last3=Deutsch |first3=Matthäus |last4=Kloft |first4=Marius |title=Machine Learning and Knowledge Discovery in Databases |chapter=Bayesian Nonlinear Support Vector Machines for Big Data |volume=10534 |pages=307–322 |year=2017 |arxiv=1707.05532 |bibcode=2017arXiv170705532W |doi=10.1007/978-3-319-71249-9_19 |series=Lecture Notes in Computer Science |isbn=978-3-319-71248-2 |s2cid=4018290 }}</ref> Florian Wenzel developed two different versions, a variational inference (VI) scheme for the Bayesian kernel support vector machine (SVM) and a stochastic version (SVI) for the linear Bayesian SVM.<ref>Florian Wenzel; Matthäus Deutsch; Théo Galy-Fajou; Marius Kloft; [http://approximateinference.org/accepted/WenzelEtAl2016.pdf ”Scalable Approximate Inference for the Bayesian Nonlinear Support Vector Machine”]</ref> == Implementation == The parameters of the maximum-margin hyperplane are derived by solving the optimization. There exist several specialized algorithms for quickly solving the [[quadratic programming]] (QP) problem that arises from SVMs, mostly relying on heuristics for breaking the problem down into smaller, more manageable chunks. Another approach is to use an [[interior-point method]] that uses [[Newton's method|Newton]]-like iterations to find a solution of the [[Karush–Kuhn–Tucker conditions]] of the primal and dual problems.<ref>{{Cite journal |doi=10.1137/S1052623400374379 |title=Interior-Point Methods for Massive Support Vector Machines |journal=SIAM Journal on Optimization |volume=13 |issue=3 |pages=783–804 |year=2002 |last1=Ferris |first1=Michael C. |last2=Munson |first2=Todd S. |url=http://www.cs.wisc.edu/~ferris/papers/siopt-svm.pdf |url-status=live |archive-url=https://web.archive.org/web/20081204224416/http://www.cs.wisc.edu/~ferris/papers/siopt-svm.pdf |archive-date=2008-12-04 |citeseerx=10.1.1.216.6893 |s2cid=13563302 }}</ref> Instead of solving a sequence of broken-down problems, this approach directly solves the problem altogether. To avoid solving a linear system involving the large kernel matrix, a low-rank approximation to the matrix is often used in the kernel trick. Another common method is Platt's [[sequential minimal optimization]] (SMO) algorithm, which breaks the problem down into 2-dimensional sub-problems that are solved analytically, eliminating the need for a numerical optimization algorithm and matrix storage. This algorithm is conceptually simple, easy to implement, generally faster, and has better scaling properties for difficult SVM problems.<ref>{{cite conference |first=John C. |last=Platt |title=Sequential Minimal Optimization: A Fast Algorithm for Training Support Vector Machines |conference=NIPS |year=1998 |url=http://research.microsoft.com/pubs/69644/tr-98-14.pdf |url-status=live |archive-url=https://web.archive.org/web/20150702075055/http://research.microsoft.com/pubs/69644/tr-98-14.pdf |archive-date=2015-07-02 }}</ref> The special case of linear support vector machines can be solved more efficiently by the same kind of algorithms used to optimize its close cousin, [[logistic regression]]; this class of algorithms includes [[Stochastic gradient descent|sub-gradient descent]] (e.g., PEGASOS<ref>{{cite conference |first1=Shai |last1=Shalev-Shwartz |first2=Yoram |last2=Singer |first3=Nathan |last3=Srebro |title=Pegasos: Primal Estimated sub-GrAdient SOlver for SVM |conference=ICML |year=2007 |url=http://ttic.uchicago.edu/~shai/papers/ShalevSiSr07.pdf |url-status=live |archive-url=https://web.archive.org/web/20131215051700/http://ttic.uchicago.edu/~shai/papers/ShalevSiSr07.pdf |archive-date=2013-12-15 }}</ref>) and [[coordinate descent]] (e.g., LIBLINEAR<ref>{{cite journal |first1=Rong-En |last1=Fan |first2=Kai-Wei |last2=Chang |first3=Cho-Jui |last3=Hsieh |first4=Xiang-Rui |last4=Wang |first5=Chih-Jen |last5=Lin |title=LIBLINEAR: A library for large linear classification |url=https://www.csie.ntu.edu.tw/~cjlin/papers/liblinear.pdf |journal=[[Journal of Machine Learning Research]] |volume=9 |pages=1871–1874 |year=2008 }}</ref>). LIBLINEAR has some attractive training-time properties. Each convergence iteration takes time linear in the time taken to read the train data, and the iterations also have a [[Rate of convergence|Q-linear convergence]] property, making the algorithm extremely fast. The general kernel SVMs can also be solved more efficiently using [[Stochastic gradient descent|sub-gradient descent]] (e.g. P-packSVM<ref>{{cite conference |first1=Zeyuan |last1=Allen Zhu |first2=Weizhu |last2=Chen |first3=Gang |last3=Wang |first4=Chenguang |last4=Zhu |first5=Zheng |last5=Chen |title=P-packSVM: Parallel Primal grAdient desCent Kernel SVM |conference=ICDM |year=2009 |url=http://people.csail.mit.edu/zeyuan/paper/2009-ICDM-Parallel.pdf |url-status=live |archive-url=https://web.archive.org/web/20140407095709/http://people.csail.mit.edu/zeyuan/paper/2009-ICDM-Parallel.pdf |archive-date=2014-04-07 }}</ref>), especially when [[parallelization]] is allowed. Kernel SVMs are available in many machine-learning toolkits, including [[LIBSVM]], [[MATLAB]], [http://support.sas.com/documentation/cdl/en/whatsnew/64209/HTML/default/viewer.htm#emdocwhatsnew71.htm SAS], SVMlight, [https://cran.r-project.org/package=kernlab kernlab], [[scikit-learn]], [[Shogun (toolbox)|Shogun]], [[Weka (machine learning)|Weka]], [http://image.diku.dk/shark/ Shark], [https://mloss.org/software/view/409/ JKernelMachines], [[OpenCV]] and others. Preprocessing of data (standardization) is highly recommended to enhance accuracy of classification.<ref> {{Cite journal| volume = 9| issue = Aug| pages = 1871–1874| last1 = Fan| first1 = Rong-En| last2 = Chang| first2 = Kai-Wei| last3 = Hsieh| first3 = Cho-Jui| last4 = Wang| first4 = Xiang-Rui| last5 = Lin| first5 = Chih-Jen| title = LIBLINEAR: A library for large linear classification| journal = Journal of Machine Learning Research| date = 2008}}</ref> There are a few methods of standardization, such as min-max, normalization by decimal scaling, Z-score.<ref>{{Cite journal| doi = 10.19026/rjaset.6.3638| volume = 6| pages = 3299–3303| last1 = Mohamad| first1 = Ismail| last2 = Usman| first2 = Dauda| title = Standardization and Its Effects on K-Means Clustering Algorithm| journal = Research Journal of Applied Sciences, Engineering and Technology| date = 2013-09-01| issue = 17| doi-access = free}}</ref> Subtraction of mean and division by variance of each feature is usually used for SVM.<ref>{{Cite journal| doi = 10.1140/epjds/s13688-019-0201-0| volume = 8| last1 = Fennell| first1 = Peter| last2 = Zuo| first2 = Zhiya| last3 = Lerman| first3 = Kristina|author3-link=Kristina Lerman| title = Predicting and explaining behavioral data with structured feature space decomposition| journal = EPJ Data Science| date = 2019-12-01| doi-access = free| arxiv = 1810.09841}}</ref> == See also == * [[In situ adaptive tabulation]] * [[Kernel machines]] * [[Fisher kernel]] * [[Platt scaling]] * [[Polynomial kernel]] * [[Predictive analytics]] * [[Regularization perspectives on support vector machines]] * [[Relevance vector machine]], a probabilistic sparse-kernel model identical in functional form to SVM * [[Sequential minimal optimization]] * [[Space mapping]] * [[Winnow (algorithm)]] == References == {{Reflist|30em}} == Further reading == *{{cite journal |last1=Bennett |first1=Kristin P. |last2=Campbell |first2=Colin |url=http://kdd.org/exploration_files/bennett.pdf |title=Support Vector Machines: Hype or Hallelujah? |journal=SIGKDD Explorations |volume=2 |issue=2 |year=2000 |pages=1–13 |doi=10.1145/380995.380999|s2cid=207753020 }} *{{cite book |last1=Cristianini |first1=Nello |last2=Shawe-Taylor |first2=John |title=An Introduction to Support Vector Machines and other kernel-based learning methods |publisher=Cambridge University Press |year=2000 |isbn=0-521-78019-5 }} *{{cite book |last1=Fradkin |first1=Dmitriy |last2=Muchnik |first2=Ilya |chapter-url=http://paul.rutgers.edu/~dfradkin/papers/svm.pdf |chapter=Support Vector Machines for Classification |editor-last=Abello |editor-first=J. |editor2-last=Carmode |editor2-first=G. |title=Discrete Methods in Epidemiology |series=DIMACS Series in Discrete Mathematics and Theoretical Computer Science |volume=70 |pages=13–20 |year=2006 }}{{Citation not found|date=June 2022}} * {{cite book |last1=Joachims |first1=Thorsten |chapter=Text categorization with Support Vector Machines: Learning with many relevant features |date=1998 |publisher=Springer |location=Berlin, Heidelberg |page=137-142 |title="Machine Learning: ECML-98 |series=Lecture Notes in Computer Science |volume=1398 |editor1-last=Nédellec |editor1-first=Claire |editor2-last=Rouveirol |editor2-first=Céline |doi=10.1007/BFb0026683|isbn=978-3-540-64417-0 |s2cid=2427083 }} *{{cite journal |last=Ivanciuc |first=Ovidiu |url=http://www.ivanciuc.org/Files/Reprint/Ivanciuc_SVM_CCR_2007_23_291.pdf |title=Applications of Support Vector Machines in Chemistry |journal=Reviews in Computational Chemistry |volume=23 |year=2007 |pages=291–400 |doi=10.1002/9780470116449.ch6 |isbn=9780470116449 }} *{{cite book |first1=Gareth |last1=James |first2=Daniela |last2=Witten |first3=Trevor |last3=Hastie |first4=Robert |last4=Tibshirani |title=An Introduction to Statistical Learning : with Applications in R |location=New York |publisher=Springer |year=2013 |isbn=978-1-4614-7137-0 |chapter=Support Vector Machines |pages=337–372 |chapter-url=http://www-bcf.usc.edu/~gareth/ISL/ISLR%20Seventh%20Printing.pdf#page=345 }} *{{cite book |last1=Schölkopf |first1=Bernhard |last2=Smola |first2=Alexander J. |title=Learning with Kernels |publisher=MIT Press |location=Cambridge, MA |year=2002 |isbn=0-262-19475-9 }} *{{cite book |last1=Steinwart |first1=Ingo |last2=Christmann |first2=Andreas |title=Support Vector Machines |publisher=Springer |location=New York |year=2008 |isbn=978-0-387-77241-7 }} *{{cite book |last1=Theodoridis |first1=Sergios |last2=Koutroumbas |first2=Konstantinos |title=Pattern Recognition |edition=4th |publisher=Academic Press |year=2009 |isbn=978-1-59749-272-0 }} == External links == * [http://www.csie.ntu.edu.tw/~cjlin/libsvm/ libsvm], [[LIBSVM]] is a popular library of SVM learners * [http://www.csie.ntu.edu.tw/~cjlin/liblinear/ liblinear] is a library for large linear classification including some SVMs * [http://svmlight.joachims.org SVM light] is a collection of software tools for learning and classification using SVM * [http://cs.stanford.edu/people/karpathy/svmjs/demo/ SVMJS live demo] {{Webarchive|url=https://web.archive.org/web/20130505185215/http://cs.stanford.edu/people/karpathy/svmjs/demo/ |date=2013-05-05 }} is a GUI demo for [[JavaScript]] implementation of SVMs {{Authority control}} {{DEFAULTSORT:Support Vector Machine}} [[Category:Support vector machines| ]] [[Category:Classification algorithms]] [[Category:Statistical classification]]'
Unified diff of changes made by edit ($1) (edit_diff)
'@@ -3,5 +3,5 @@ In [[machine learning]], '''support vector machines''' ('''SVMs''', also '''support vector networks'''<ref name="CorinnaCortes" />) are [[supervised learning|supervised]] [[Maximum-margin hyperplane|max-margin]] models with associated learning [[algorithm]]s that analyze data for [[Statistical classification|classification]] and [[regression analysis]]. Developed at [[AT&T Bell Laboratories]] by [[Vladimir Vapnik]] with colleagues (Boser et al., 1992, [[Isabelle Guyon|Guyon]] et al., 1993, [[Corinna Cortes|Cortes]] and [[Vladimir Vapnik|Vapnik]], 1995,<ref name="CorinnaCortes" /> Vapnik et al., 1997<ref>{{Cite journal |last=Vapnik |first=Vladimir N. |date=1997 |editor-last=Gerstner |editor-first=Wulfram |editor2-last=Germond |editor2-first=Alain |editor3-last=Hasler |editor3-first=Martin |editor4-last=Nicoud |editor4-first=Jean-Daniel |title=The Support Vector method |url=https://link.springer.com/chapter/10.1007/BFb0020166 |journal=Artificial Neural Networks — ICANN'97 |language=en |location=Berlin, Heidelberg |publisher=Springer |pages=261–271 |doi=10.1007/BFb0020166 |isbn=978-3-540-69620-9}}</ref>) SVMs are one of the most studied models, being based on statistical learning frameworks of [[VC theory]] proposed by Vapnik (1982, 1995) and [[Alexey Chervonenkis|Chervonenkis]] (1974). -In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive. +In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], which represent the data only through a set of pairwise similarity comparisons between the original data observations and representing the data by these transformed coordinates in the higher dimensional feature space. Thus, SVMs use the kernel trick to implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive. The support vector clustering<ref name="HavaSiegelmann">{{cite journal |last1=Ben-Hur |first1=Asa |last2=Horn |first2=David |last3=Siegelmann |first3=Hava |last4=Vapnik |first4=Vladimir N. |title="Support vector clustering" (2001); |journal=Journal of Machine Learning Research |volume=2 |pages=125–137}}</ref> algorithm, created by [[Hava Siegelmann]] and [[Vladimir Vapnik]], applies the statistics of support vectors, developed in the support vector machines algorithm, to categorize unlabeled data.{{Citation needed|date=March 2018}} These data sets require [[unsupervised learning]] approaches, which attempt to find natural [[Cluster analysis|clustering of the data]] to groups and, then, to map new data according to these clusters. '
New page size ($1) (new_size)
64978
Old page size ($1) (old_size)
64725
Size change in edit ($1) (edit_delta)
253
Lines added in edit ($1) (added_lines)
[ 0 => 'In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], which represent the data only through a set of pairwise similarity comparisons between the original data observations and representing the data by these transformed coordinates in the higher dimensional feature space. Thus, SVMs use the kernel trick to implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive.' ]
Lines removed in edit ($1) (removed_lines)
[ 0 => 'In addition to performing [[linear classifier|linear classification]], SVMs can efficiently perform a non-linear classification using what is called the [[Kernel method#Mathematics: the kernel trick|kernel trick]], implicitly mapping their inputs into high-dimensional feature spaces. Being max-margin models, SVMs are resilient to noisy data (for example, mis-classified examples). SVMs can also be used for [[Regression analysis|regression]] tasks, where the objective becomes <math>\epsilon</math>-sensitive.' ]
Whether or not the change was made through a Tor exit node ($1) (tor_exit_node)
false
Unix timestamp of change ($1) (timestamp)
'1716512778'