Support vector machine

3,897 words · about 19 min read · Machine Learning

In machine learning, a support vector machine (SVM) or support vector network is a supervised max-margin model with associated learning algorithms that analyze data for classification and regression analysis. Developed at AT&T Bell Laboratories, SVMs are one of the most studied models, being based on statistical learning frameworks of VC theory proposed by Vapnik (1982, 1995) and Chervonenkis (1974). In addition to performing linear classification, SVMs can efficiently perform non-linear classification using the kernel trick, representing the data only through a set of pairwise similarity comparisons between the original data points using a kernel function, which transforms them into coordinates in a higher-dimensional feature space. Thus, SVMs use the kernel trick to implicitly map their inputs into high-dimensional feature spaces, where linear classification can be performed. Being max-margin models, SVMs are resilient to noisy data (e.g., misclassified examples). SVMs can also be used for regression tasks, where the objective becomes

ϵ

{\displaystyle \epsilon }

-sensitive. The support vector clustering 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. These data sets require unsupervised learning approaches, which attempt to find natural clustering of the data into groups, and then to map new data according to these clusters. The popularity of SVMs is likely due to their amenability to theoretical analysis, and their flexibility in being applied to a wide variety of tasks, including structured prediction problems. It is not clear that SVMs have better predictive performance than other linear models, such as logistic regression and linear regression.

Motivation

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

p

{\displaystyle p}

-dimensional vector (a list of

p

{\displaystyle p}

numbers), and we want to know whether we can separate such points with a

( p − 1 )

{\displaystyle (p-1)}

-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, 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 of optimal stability. 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 classification, regression, or other tasks like outlier detection. 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. A lower generalization error means that the implementer is less likely to experience overfitting. Whereas the original problem may be stated in a finite-dimensional space, it often happens that the sets to discriminate are not linearly separable in that space. For this reason, it was proposed 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 products 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 kernel function

k ( x , y )

{\displaystyle k(x,y)}

selected to suit the problem. 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

α

i

{\displaystyle \alpha _{i}}

of images of feature vectors

x

i

{\displaystyle x_{i}}

that occur in the data base. With this choice of a hyperplane, the points

x

{\displaystyle x}

in the feature space that are mapped into the hyperplane are defined by the relation

i

α

i

k (

x

i

, x ) =

constant

.

{\displaystyle \textstyle \sum _{i}\alpha _{i}k(x_{i},x)={\text{constant}}.}

Note that if

k ( x , y )

{\displaystyle k(x,y)}

becomes small as

y

{\displaystyle y}

grows further away from

x

{\displaystyle x}

, each term in the sum measures the degree of closeness of the test point

x

{\displaystyle x}

to the corresponding data base point

x

i

{\displaystyle x_{i}}

. 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

x

{\displaystyle x}

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 and hypertext categorization, as their application can significantly reduce the need for labeled training instances in both the standard inductive and transductive settings. Some methods for shallow semantic parsing are based on support vector machines. 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. Classification of satellite data like SAR data using supervised SVM. Hand-written characters can be recognized using SVM. 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 tests based on SVM weights have been suggested as a mechanism for interpretation of SVM models. Support vector machine weights have also been used to interpret SVM models in the past. 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 Ya. Chervonenkis in 1964. 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. The "soft margin" incarnation, as is commonly used in software packages, was proposed by Corinna Cortes and Vapnik in 1993 and published in 1995.

Linear SVM

We are given a training dataset of

n

{\displaystyle n}

points of the form

(

x

1

,

y

1

) , … , (

x

n

,

y

n

) ,

{\displaystyle (\mathbf {x} _{1},y_{1}),\ldots ,(\mathbf {x} _{n},y_{n}),}

where the

y

i

{\displaystyle y_{i}}

are either 1 or −1, each indicating the class to which the point

x

i

{\displaystyle \mathbf {x} _{i}}

belongs. Each

x

i

{\displaystyle \mathbf {x} _{i}}

is a

p

{\displaystyle p}

-dimensional real vector. We want to find the "maximum-margin hyperplane" that divides the group of points

x

i

{\displaystyle \mathbf {x} _{i}}

for which

y

i

= 1

{\displaystyle y_{i}=1}

from the group of points for which

y

i

= − 1

{\displaystyle y_{i}=-1}

, which is defined so that the distance between the hyperplane and the nearest point

x

i

{\displaystyle \mathbf {x} _{i}}

from either group is maximized. Any hyperplane can be written as the set of points

x

{\displaystyle \mathbf {x} }

satisfying

w

T

x

− b = 0 ,

{\displaystyle \mathbf {w} ^{\mathsf {T}}\mathbf {x} -b=0,}

where

w

{\displaystyle \mathbf {w} }

is the (not necessarily normalized) normal vector to the hyperplane. This is much like Hesse normal form, except that

w

{\displaystyle \mathbf {w} }

is not necessarily a unit vector. The parameter

b

w

{\displaystyle {\tfrac {b}{\|\mathbf {w} \|}}}

determines the offset of the hyperplane from the origin along the normal vector

w

{\displaystyle \mathbf {w} }

. The bias may also be defined so that

w

T

x

+ b = 0.

{\displaystyle \mathbf {w} ^{\mathsf {T}}\mathbf {x} +b=0.}

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

w

T

x

− b = 1

{\displaystyle \mathbf {w} ^{\mathsf {T}}\mathbf {x} -b=1}

(anything on or above this boundary is of one class, with label 1) and

w

T

x

− b = − 1

{\displaystyle \mathbf {w} ^{\mathsf {T}}\mathbf {x} -b=-1}

(anything on or below this boundary is of the other class, with label −1). Geometrically, the distance between these two hyperplanes is

2

w

{\displaystyle {\tfrac {2}{\|\mathbf {w} \|}}}

, so to maximize the distance between the planes we want to minimize

w

{\displaystyle \|\mathbf {w} \|}

. 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

i

{\displaystyle i}

either

w

T

x

i

− b ≥ 1

,

if

y

i

= 1 ,

{\displaystyle \mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-b\geq 1\,,{\text{ if }}y_{i}=1,}

or

w

T

x

i

− b ≤ − 1

,

if

y

i

= − 1.

{\displaystyle \mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-b\leq -1\,,{\text{ if }}y_{i}=-1.}

These constraints state that each data point must lie on the correct side of the margin. This can be rewritten as

We can put this together to get the optimization problem:

minimize

w

,

b

1 2

w

2

subject to

y

i

(

w

x

i

− b ) ≥ 1

∀ i ∈ { 1 , … , n }

{\displaystyle {\begin{aligned}&{\underset {\mathbf {w} ,\;b}{\operatorname {minimize} }}&&{\frac {1}{2}}\|\mathbf {w} \|^{2}\\&{\text{subject to}}&&y_{i}(\mathbf {w} ^{\top }\mathbf {x} _{i}-b)\geq 1\quad \forall i\in \{1,\dots ,n\}\end{aligned}}}

The

w

{\displaystyle \mathbf {w} }

and

b

{\displaystyle b}

that solve this problem determine the final classifier,

x

↦ sgn ⁡ (

w

T

x

− b )

{\displaystyle \mathbf {x} \mapsto \operatorname {sgn}(\mathbf {w} ^{\mathsf {T}}\mathbf {x} -b)}

, where

sgn ⁡ ( ⋅ )

{\displaystyle \operatorname {sgn}(\cdot )}

is the sign function. An important consequence of this geometric description is that the max-margin hyperplane is completely determined by those

x

i

{\displaystyle \mathbf {x} _{i}}

that lie nearest to it (explained below). These

x

i

{\displaystyle \mathbf {x} _{i}}

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

max

(

0 , 1 −

y

i

(

w

T

x

i

− b )

)

.

{\displaystyle \max \left(0,1-y_{i}(\mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-b)\right).}

Note that

y

i

{\displaystyle y_{i}}

is the i-th target (i.e., in this case, 1 or −1), and

w

T

x

i

− b

{\displaystyle \mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-b}

is the i-th output. This function is zero if the constraint in (1) is satisfied, in other words, if

x

i

{\displaystyle \mathbf {x} _{i}}

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:

w

2

+ C

[

1 n

i = 1

n

max

(

0 , 1 −

y

i

(

w

T

x

i

− b )

)

]

,

{\displaystyle \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],}

where the parameter

C > 0

{\displaystyle C>0}

determines the trade-off between increasing the margin size and ensuring that the

x

i

{\displaystyle \mathbf {x} _{i}}

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 formulated into the following:

minimize

w

,

b ,

ζ

w

2

2

+ C

i = 1

n

ζ

i

subject to

y

i

(

w

x

i

− b ) ≥ 1 −

ζ

i

,

ζ

i

≥ 0

∀ i ∈ { 1 , … , n }

{\displaystyle {\begin{aligned}&{\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{aligned}}}

Thus, for large values of

C

{\displaystyle C}

, 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

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.) to maximum-margin hyperplanes. The kernel trick, where 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. Some common kernels include:

Polynomial (homogeneous):

k (

x

i

,

x

j

) = (

x

i

x

j

)

d

{\displaystyle k(\mathbf {x} _{i},\mathbf {x} _{j})=(\mathbf {x} _{i}\cdot \mathbf {x} _{j})^{d}}

. Particularly, when

d = 1

{\displaystyle d=1}

, this becomes the linear kernel. Polynomial (inhomogeneous):

k (

x

i

,

x

j

) = (

x

i

x

j

+ r

)

d

{\displaystyle k(\mathbf {x} _{i},\mathbf {x} _{j})=(\mathbf {x} _{i}\cdot \mathbf {x} _{j}+r)^{d}}

. Gaussian radial basis function:

k (

x

i

,

x

j

) = exp ⁡

(

− γ

x

i

x

j

2

)

{\displaystyle k(\mathbf {x} _{i},\mathbf {x} _{j})=\exp \left(-\gamma \left\|\mathbf {x} _{i}-\mathbf {x} _{j}\right\|^{2}\right)}

for

γ > 0

{\displaystyle \gamma >0}

. Sometimes parametrized using

γ = 1

/

( 2

σ

2

)

{\displaystyle \gamma =1/(2\sigma ^{2})}

. Sigmoid function (Hyperbolic tangent):

k (

x

i

,

x

j

) = tanh ⁡ ( κ

x

i

x

j

+ c )

{\displaystyle k(\mathbf {x_{i}} ,\mathbf {x_{j}} )=\tanh(\kappa \mathbf {x} _{i}\cdot \mathbf {x} _{j}+c)}

for some (not every)

κ > 0

{\displaystyle \kappa >0}

and

c < 0

{\displaystyle c<0}

. The kernel is related to the transform

φ (

x

i

)

{\displaystyle \varphi (\mathbf {x} _{i})}

by the equation

k (

x

i

,

x

j

) = φ (

x

i

) ⋅ φ (

x

j

)

{\displaystyle k(\mathbf {x} _{i},\mathbf {x} _{j})=\varphi (\mathbf {x} _{i})\cdot \varphi (\mathbf {x} _{j})}

. The value w is also in the transformed space, with

w

=

i

α

i

y

i

φ (

x

i

)

{\textstyle \mathbf {w} =\sum _{i}\alpha _{i}y_{i}\varphi (\mathbf {x} _{i})}

. Dot products with w for classification can again be computed by the kernel trick, i.e.

w

⋅ φ (

x

) =

i

α

i

y

i

k (

x

i

,

x

)

{\textstyle \mathbf {w} \cdot \varphi (\mathbf {x} )=\sum _{i}\alpha _{i}y_{i}k(\mathbf {x} _{i},\mathbf {x} )}

.

Computing the SVM classifier

Computing the (soft-margin) SVM classifier amounts to minimizing an expression of the form

We focus on the soft-margin classifier since, as noted above, choosing a sufficiently small value for

λ

{\displaystyle \lambda }

yields the hard-margin classifier for linearly classifiable input data. The classical approach, which involves reducing (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 (2) can be rewritten as a constrained optimization problem with a differentiable objective function in the following way. For each

i ∈ { 1 ,

… ,

n }

{\displaystyle i\in \{1,\,\ldots ,\,n\}}

we introduce a variable

ζ

i

= max

(

0 , 1 −

y

i

(

w

T

x

i

− b )

)

{\displaystyle \zeta _{i}=\max \left(0,1-y_{i}(\mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-b)\right)}

. Note that

ζ

i

{\displaystyle \zeta _{i}}

is the smallest nonnegative number satisfying

y

i

(

w

T

x

i

− b ) ≥ 1 −

ζ

i

.

{\displaystyle y_{i}(\mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-b)\geq 1-\zeta _{i}.}

Thus we can rewrite the optimization problem as follows

minimize

1 n

i = 1

n

ζ

i

+ λ ‖

w

2

subject to

y

i

(

w

T

x

i

− b

)

≥ 1 −

ζ

i

and

ζ

i

≥ 0 ,

for all

i .

{\displaystyle {\begin{aligned}&{\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{aligned}}}

This is called the primal problem.

Dual

By solving for the Lagrangian dual of the above problem, one obtains the simplified problem

maximize

f (

c

1

c

n

) =

i = 1

n

c

i

1 2

i = 1

n

j = 1

n

y

i

c

i

(

x

i

T

x

j

)

y

j

c

j

,

subject to

i = 1

n

c

i

y

i

= 0 ,

and

0 ≤

c

i

1

2 n λ

for all

i .

{\displaystyle {\begin{aligned}&{\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_{i}y_{i}=0,\,{\text{and }}0\leq c_{i}\leq {\frac {1}{2n\lambda }}\;{\text{for all }}i.\end{aligned}}}

This is called the dual problem. Since the dual maximization problem is a quadratic function of the

c

i

{\displaystyle c_{i}}

subject to linear constraints, it is efficiently solvable by quadratic programming algorithms. Here, the variables

c

i

{\displaystyle c_{i}}

are defined such that

w

=

i = 1

n

c

i

y

i

x

i

.

{\displaystyle \mathbf {w} =\sum _{i=1}^{n}c_{i}y_{i}\mathbf {x} _{i}.}

Moreover,

c

i

= 0

{\displaystyle c_{i}=0}

exactly when

x

i

{\displaystyle \mathbf {x} _{i}}

lies on the correct side of the margin, and

0 <

c

i

< ( 2 n λ

)

− 1

{\displaystyle 0<c_{i}<(2n\lambda )^{-1}}

when

x

i

{\displaystyle \mathbf {x} _{i}}

lies on the margin's boundary. It follows that

w

{\displaystyle \mathbf {w} }

can be written as a linear combination of the support vectors. The offset,

b

{\displaystyle b}

, can be recovered by finding an

x

i

{\displaystyle \mathbf {x} _{i}}

on the margin's boundary and solving

y

i

(

w

T

x

i

− b ) = 1

b =

w

T

x

i

y

i

.

{\displaystyle y_{i}(\mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-b)=1\iff b=\mathbf {w} ^{\mathsf {T}}\mathbf {x} _{i}-y_{i}.}

(Note that

y

i

− 1

=

y

i

{\displaystyle y_{i}^{-1}=y_{i}}

since

y

i

= ± 1

{\displaystyle y_{i}=\pm 1}

.)

Kernel trick

Suppose now that we would like to learn a nonlinear classification rule which corresponds to a linear classification rule for the transformed data points

φ (

x

i

) .

{\displaystyle \varphi (\mathbf {x} _{i}).}

Moreover, we are given a kernel function

k

{\displaystyle k}

which satisfies

k (

x

i

,

x

j

) = φ (

x

i

) ⋅ φ (

x

j

)

{\displaystyle k(\mathbf {x} _{i},\mathbf {x} _{j})=\varphi (\mathbf {x} _{i})\cdot \varphi (\mathbf {x} _{j})}

. We know the classification vector

w

{\displaystyle \mathbf {w} }

in the transformed space satisfies

w

=

i = 1

n

c

i

y

i

φ (

x

i

) ,

{\displaystyle \mathbf {w} =\sum _{i=1}^{n}c_{i}y_{i}\varphi (\mathbf {x} _{i}),}

where, the

c

i

{\displaystyle c_{i}}

are obtained by solving the optimization problem

maximize

f (

c

1

c

n

)

=

i = 1

n

c

i

1 2

i = 1

n

j = 1

n

y

i

c

i

( φ (

x

i

) ⋅ φ (

x

j

) )

y

j

c

j

=

i = 1

n

c

i

1 2

i = 1

n

j = 1

n

y

i

c

i

k (

x

i

,

x

j

)

y

j

c

j

subject to

i = 1

n

c

i

y

i

= 0 ,

and

0 ≤

c

i

1

2 n λ

for all

i .

{\displaystyle {\begin{aligned}{\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}(\varphi (\mathbf {x} _{i})\cdot \varphi (\mathbf {x} _{j}))y_{j}c_{j}\\&=\sum _{i=1}^{n}c_{i}-{\frac {1}{2}}\sum _{i=1}^{n}\sum _{j=1}^{n}y_{i}c_{i}k(\mathbf {x} _{i},\mathbf {x} _{j})y_{j}c_{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{aligned}}}

The coefficients

c

i

{\displaystyle c_{i}}

can be solved for using quadratic programming, as before. Again, we can find some index

i

{\displaystyle i}

such that

0 <

c

i

< ( 2 n λ

)

− 1

{\displaystyle 0<c_{i}<(2n\lambda )^{-1}}

, so that

φ (

x

i

)

{\displaystyle \varphi (\mathbf {x} _{i})}

lies on the boundary of the margin in the transformed space, and then solve

b =

w

T

φ (

x

i

) −

y

i

=

[

j = 1

n

c

j

y

j

φ (

x

j

) ⋅ φ (

x

i

)

]

y

i

=

[

j = 1

n

c

j

y

j

k (

x

j

,

x

i

)

]

y

i

.

{\displaystyle {\begin{aligned}b=\mathbf {w} ^{\mathsf {T}}\varphi (\mathbf {x} _{i})-y_{i}&=\left[\sum _{j=1}^{n}c_{j}y_{j}\varphi (\mathbf {x} _{j})\cdot \varphi (\mathbf {x} _{i})\right]-y_{i}\\&=\left[\sum _{j=1}^{n}c_{j}y_{j}k(\mathbf {x} _{j},\mathbf {x} _{i})\right]-y_{i}.\end{aligned}}}

Finally,

z

↦ sgn ⁡ (

w

T

φ (

z

) − b ) = sgn ⁡

(

[

i = 1

n

c

i

y

i

k (

x

i

,

z

)

]

− b

)

.

{\displaystyle \mathbf {z} \mapsto \operatorname {sgn}(\mathbf {w} ^{\mathsf {T}}\varphi (\mathbf {z} )-b)=\operatorname {sgn} \left(\left[\sum _{i=1}^{n}c_{i}y_{i}k(\mathbf {x} _{i},\mathbf {z} )\right]-b\right).}

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

Sub-gradient descent algorithms for the SVM work directly with the expression

f (

w

, b ) =

[

Source: Support vector machine on Wikipedia · CC BY-SA 4.0