Least-squares support vector machine explained

Least-squares support-vector machines (LS-SVM) for statistics and in statistical modeling, are least-squares versions of support-vector machines (SVM), which are a set of related supervised learning methods that analyze data and recognize patterns, and which are used for classification and regression analysis. In this version one finds the solution by solving a set of linear equations instead of a convex quadratic programming (QP) problem for classical SVMs. Least-squares SVM classifiers were proposed by Johan Suykens and Joos Vandewalle.[1] LS-SVMs are a class of kernel-based learning methods.

From support-vector machine to least-squares support-vector machine

Given a training set

\{xi,yi

N
\}
i=1
with input data

xi\inRn

and corresponding binary class labels

yi\in\{-1,+1\}

, the SVM[2] classifier, according to Vapnik's original formulation, satisfies the following conditions:

\begin{cases} wT\phi(xi)+b\ge1,&ifyi=+1,\\ wT\phi(xi)+b\le-1,&ifyi=-1, \end{cases}

which is equivalent to

yi\left[{wT\phi(xi)+b}\right]\ge1,i=1,\ldots,N,

where

\phi(x)

is the nonlinear map from original space to the high- or infinite-dimensional space.

Inseparable data

In case such a separating hyperplane does not exist, we introduce so-called slack variables

\xii

such that

\begin{cases} yi\left[{wT\phi(xi)+b}\right]\ge1-\xii,&i=1,\ldots,N,\\ \xii\ge0,&i=1,\ldots,N. \end{cases}

According to the structural risk minimization principle, the risk bound is minimized by the following minimization problem:

minJ1(w,\xi)=

1
2

wTw+

N
c\sum\limits
i=1

\xii,

Subjectto\begin{cases} yi\left[{wT\phi(xi)+b}\right]\ge1-\xii,&i=1,\ldots,N,\\ \xii\ge0,&i=1,\ldots,N, \end{cases}

To solve this problem, we could construct the Lagrangian function:

L
1(w,b,\xi,\alpha,\beta)=1
2

wTw+

N
c\sum\limits
i=1

{\xii}-

N
\sum\limits
i=1

\alphai\left\{yi\left[{wT\phi(xi)+b}\right]-1+\xii\right\}-

N
\sum\limits
i=1

\betai\xii,

where

\alphai\ge0,\betai\ge0 (i=1,\ldots,N)

are the Lagrangian multipliers. The optimal point will be in the saddle point of the Lagrangian function, and then we obtain

By substituting

w

by its expression in the Lagrangian formed from the appropriate objective and constraints, we will get the following quadratic programming problem:

maxQ1(\alpha)=-

1
2
N
\sum\limits
i,j=1

{\alphai\alphajyiyjK(xi,xj)}+

N
\sum\limits
i=1

\alphai,

where

K(xi,xj)=\left\langle\phi(xi),\phi(xj)\right\rangle

is called the kernel function. Solving this QP problem subject to constraints in, we will get the hyperplane in the high-dimensional space and hence the classifier in the original space.

Least-squares SVM formulation

The least-squares version of the SVM classifier is obtained by reformulating the minimization problem as

minJ2(w,b,e)=

\mu
2

wTw+

\zeta
2
N
\sum\limits
i=1
2,
e
i

subject to the equality constraints

yi\left[{wT\phi(xi)+b}\right]=1-ei,i=1,\ldots,N.

The least-squares SVM (LS-SVM) classifier formulation above implicitly corresponds to a regression interpretation with binary targets

yi=\pm1

.

Using

2
y
i

=1

, we have
N
\sum\limits
i=1
2
e
i

=

N
\sum\limits
i=1

(yi

2
e
i)

=

N
\sum\limits
i=1
2
e
i

=

N
\sum\limits
i=1

\left(yi-(wT\phi(xi)+b)\right)2,

with

ei=yi-(wT\phi(xi)+b).

Notice, that this error would also make sense for least-squares data fitting, so that the same end results holds for the regression case.

Hence the LS-SVM classifier formulation is equivalent to

J2(w,b,e)=\muEW+\zetaED

with

EW=

1
2

wTw

and

ED=

1
2
N
\sum\limits
i=1
2
e
i

=

1
2
N
\sum\limits
i=1

\left(yi-(wT\phi(xi)+b)\right)2.

Both

\mu

and

\zeta

should be considered as hyperparameters to tune the amount of regularization versus the sum squared error. The solution does only depend on the ratio

\gamma=\zeta/\mu

, therefore the original formulation uses only

\gamma

as tuning parameter. We use both

\mu

and

\zeta

as parameters in order to provide a Bayesian interpretation to LS-SVM.

The solution of LS-SVM regressor will be obtained after we construct the Lagrangian function:

\begin{cases} L2(w,b,e,\alpha)=J2(w,e)-

N
\sum\limits
i=1

\alphai\left\{{\left[{wT\phi(xi)+b}\right]+ei-yi}\right\},\\ =

1
2

wTw+

\gamma
2
N
\sum\limits
i=1
2
e
i

-

N
\sum\limits
i=1

\alphai\left\{\left[wT\phi(xi)+b\right]+ei-yi\right\}, \end{cases}

where

\alphai\inR

are the Lagrange multipliers. The conditions for optimality are

\begin{cases}

\partialL2
\partialw

=0   \tow=

N
\sum\limits
i=1

\alphai\phi(xi),\\

\partialL2
\partialb

=0   \to

N
\sum\limits
i=1

\alphai=0,\\

\partialL2
\partialei

=0   \to\alphai=\gammaei,i=1,\ldots,N,\\

\partialL2
\partial\alphai

=0   \toyi=wT\phi(xi)+b+ei,i=1,\ldots,N. \end{cases}

Elimination of

w

and

e

will yield a linear system instead of a quadratic programming problem:

\left[\begin{matrix} 0&

T
1
N

\\ 1N&\Omega+\gammaIN \end{matrix}\right]\left[\begin{matrix} b\\ \alpha \end{matrix}\right]=\left[\begin{matrix} 0\\ Y \end{matrix}\right],

with

Y=[y1,\ldots,yN]T

,

1N=[1,\ldots,1]T

and

\alpha=[\alpha1,\ldots,\alphaN]T

. Here,

IN

is an

N x N

identity matrix, and

\Omega\inRN

is the kernel matrix defined by

\Omegaij=\phi(xi)T\phi(xj)=K(xi,xj)

.

Kernel function K

For the kernel function K(•, •) one typically has the following choices:

K(x,xi)=

T
x
i

x,

d

:

K(x,xi)=\left({1+

T
x
i

x/c}\right)d,

K(x,xi)=\exp\left({-\left\|{x-xi}\right\|2/\sigma2}\right),

K(x,xi)=\tanh\left(

T
{kx
i

x+\theta}\right),

where

d

,

c

,

\sigma

,

k

and

\theta

are constants. Notice that the Mercer condition holds for all

c,\sigma\inR+

and

d\inN

values in the polynomial and RBF case, but not for all possible choices of

k

and

\theta

in the MLP case. The scale parameters

c

,

\sigma

and

k

determine the scaling of the inputs in the polynomial, RBF and MLP kernel function. This scaling is related to the bandwidth of the kernel in statistics, where it is shown that the bandwidth is an important parameter of the generalization behavior of a kernel method.

Bayesian interpretation for LS-SVM

A Bayesian interpretation of the SVM has been proposed by Smola et al. They showed that the use of different kernels in SVM can be regarded as defining different prior probability distributions on the functional space, as

P[f]\propto\exp\left({-\beta\left\|{\hatPf}\right\|2}\right)

. Here

\beta>0

is a constant and

\hat{P}

is the regularization operator corresponding to the selected kernel.

A general Bayesian evidence framework was developed by MacKay,[3] [4] [5] and MacKay has used it to the problem of regression, forward neural network and classification network. Provided data set

D

, a model

M

with parameter vector

w

and a so-called hyperparameter or regularization parameter

λ

, Bayesian inference is constructed with 3 levels of inference:

λ

, the first level of inference infers the posterior distribution of

w

by Bayesian rule

p(w|D,λ,M)\proptop(D|w,M)p(w|λ,M).

λ

, by maximizing

p(λ|D,M)\proptop(D|λ,M)p(λ|M).

p(M|D)\proptop(D|M)p(M).

We can see that Bayesian evidence framework is a unified theory for learning the model and model selection.Kwok used the Bayesian evidence framework to interpret the formulation of SVM and model selection. And he also applied Bayesian evidence framework to support vector regression.

Now, given the data points

\{xi,yi\}

N
i=1
and the hyperparameters

\mu

and

\zeta

of the model

M

, the model parameters

w

and

b

are estimated by maximizing the posterior

p(w,b|D,log\mu,log\zeta,M)

. Applying Bayes’ rule, we obtain

p(w,b|D,log\mu,log\zeta,M)=

{p(D|w,b,log\mu,log\zeta,M)p(w,b|log\mu,log\zeta,M)
},

where

p(D|log\mu,log\zeta,M)

is a normalizing constant such the integral over all possible

w

and

b

is equal to 1.We assume

w

and

b

are independent of the hyperparameter

\zeta

, and are conditional independent, i.e., we assume

p(w,b|log\mu,log\zeta,M)=p(w|log\mu,M)p(b|log\sigmab,M).

When

\sigmab\toinfty

, the distribution of

b

will approximate a uniform distribution. Furthermore, we assume

w

and

b

are Gaussian distribution, so we obtain the a priori distribution of

w

and

b

with

\sigmab\toinfty

to be

\begin{array}{l} p(w,b|log\mu,)=\left({

\mu
{2\pi
}} \right)^ \exp \left(\right)\frac\exp \left(\right) \\ \quad \quad \quad \quad \quad \quad \quad \propto \left(\right)^ \exp \left(\right) \end .

Here

nf

is the dimensionality of the feature space, same as the dimensionality of

w

.

The probability of

p(D|w,b,log\mu,log\zeta,M)

is assumed to depend only on

w,b,\zeta

and

M

. We assume that the data points are independently identically distributed (i.i.d.), so that:

p(D|w,b,log\zeta,M)=

N
\prod\limits
i=1

{p(xi,yi|w,b,log\zeta,M)}.

In order to obtain the least square cost function, it is assumed that the probability of a data point is proportional to:

p(xi,yi|w,b,log\zeta,M)\proptop(ei|w,b,log\zeta,M).

A Gaussian distribution is taken for the errors

ei=yi-(wT\phi(xi)+b)

as:

p(ei|w,b,log\zeta,M)=\sqrt{

\zeta
{2\pi
}} \exp \left(\right) .

It is assumed that the

w

and

b

are determined in such a way that the class centers

\hatm-

and

\hatm+

are mapped onto the target -1 and +1, respectively. The projections

wT\phi(x)+b

of the class elements

\phi(x)

follow a multivariate Gaussian distribution, which have variance

1/\zeta

.

Combining the preceding expressions, and neglecting all constants, Bayes’ rule becomes

p(w,b|D,log\mu,log\zeta,M)\propto\exp(-

\mu
2

wTw-

\zeta
2
N
\sum\limits
i=1
2
{e
i

})=\exp(-J2(w,b)).

The maximum posterior density estimates

wMP

and

bMP

are then obtained by minimizing the negative logarithm of (26), so we arrive (10).

References

  1. Suykens, J. A. K.; Vandewalle, J. (1999) "Least squares support vector machine classifiers", Neural Processing Letters, 9 (3), 293–300.
  2. Vapnik, V. The nature of statistical learning theory. Springer-Verlag, New York, 1995.
  3. MacKay, D. J. C. Bayesian Interpolation. Neural Computation, 4(3): 415–447, May 1992.
  4. MacKay, D. J. C. A practical Bayesian framework for backpropagation networks. Neural Computation, 4(3): 448–472, May 1992.
  5. MacKay, D. J. C. The evidence framework applied to classification networks. Neural Computation, 4(5): 720–736, Sep. 1992.

Bibliography

External links