ArticleslgStudy

computer science

Least-squares support vector machine

Least-squares support vector machine is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Least-squares support vector machine rather than just read about it. In short: 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 p…

Least-squares support vector machine — main illustration
Least-squares support vector machine — illustration

Key takeaways

  • Least-squares support vector machine belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Least-squares support vector machine to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Least-squares support vector machine from memory before moving on to harder problems.

Reference excerpt

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. 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}i=1N with input data xi∈ℝn and corresponding binary class labels yi∈{−1,+1}, the SVM classifier, according to Vapnik's original formulation, satisfies the following conditions:

{wTϕ(xi)+b≥1,if yi=+1,wTϕ(xi)+b≤−1,if yi=−1, which is equivalent to

yi[wTϕ(xi)+b]≥1,i=1,…,N, where ϕ(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 ξi such that

{yi[wTϕ(xi)+b]≥1−ξi,i=1,…,N,ξi≥0,i=1,…,N.

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

min⁡J1(w,ξ)=12wTw+c∑i=1Nξi, Subject to {yi[wTϕ(xi)+b]≥1−ξi,i=1,…,N,ξi≥0,i=1,…,N, To solve this problem, we could construct the Lagrangian function:

L1(w,b,ξ,α,β)=12wTw+c∑i=1Nξi−∑i=1Nαi{yi[wTϕ(xi)+b]−1+ξi}−∑i=1Nβiξi, where αi≥0, βi≥0 (i=1,…,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:

max⁡Q1(α)=−12∑i,j=1NαiαjyiyjK(xi,xj)+∑i=1Nαi, where K(xi,xj)=⟨ϕ(xi),ϕ(xj)⟩ is called the kernel function. Solving this QP problem subject to constraints in (1), 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

min⁡J2(w,b,e)=μ2wTw+ζ2∑i=1Nei2, subject to the equality constraints

yi[wTϕ(xi)+b]=1−ei,i=1,…,N. The least-squares SVM (LS-SVM) classifier formulation above implicitly corresponds to a regression interpretation with binary targets yi=±1. Using yi2=1, we have

∑i=1Nei2=∑i=1N(yiei)2=∑i=1Nei2=∑i=1N(yi−(wTϕ(xi)+b))2, with ei=yi−(wTϕ(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)=μEW+ζED with EW=12wTw and ED=12∑i=1Nei2=12∑i=1N(yi−(wTϕ(xi)+b))2.

Both μ and ζ should be considered as hyperparameters to tune the amount of regularization versus the sum squared error. The solution does only depend on the ratio γ=ζ/μ, therefore the original formulation uses only γ as tuning parameter. We use both μ and ζ 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:

{L2(w,b,e,α)=J2(w,e)−∑i=1Nαi{[wTϕ(xi)+b]+ei−yi},=12wTw+γ2∑i=1Nei2−∑i=1Nαi{[wTϕ(xi)+b]+ei−yi}, where αi∈ℝ are the Lagrange multipliers. The conditions for optimality are

{∂L2∂w=0→w=∑i=1Nαiϕ(xi),∂L2∂b=0→∑i=1Nαi=0,∂L2∂ei=0→αi=γei,i=1,…,N,∂L2∂αi=0→yi=wTϕ(xi)+b+ei,i=1,…,N. Elimination of w and e will yield a linear system instead of a quadratic programming problem:

[01NT1NΩ+γ−1IN][bα]=[0Y], with Y=[y1,…,yN]T, 1N=[1,…,1]T and α=[α1,…,αN]T. Here, IN is an N×N identity matrix, and Ω∈ℝN×N is the kernel matrix defined by Ωij=ϕ(xi)Tϕ(xj)=K(xi,xj).

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

Linear kernel : K(x,xi)=xiTx, Polynomial kernel of degree d: K(x,xi)=(1+xiTx/c)d, Radial basis function RBF kernel : K(x,xi)=exp⁡(−‖x−xi‖2/σ2), MLP kernel : K(x,xi)=tanh⁡(kxiTx+θ), where d, c, σ, k and θ are constants. Notice that the Mercer condition holds for all c,σ∈ℝ+ and d∈N values in the polynomial and RBF case, but not for all possible choices of k and θ in the MLP case. The scale parameters c, σ 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]∝exp⁡(−β‖P̂f‖2). Here β>0 is a constant and P̂ is the regularization operator corresponding to the selected kernel. A general Bayesian evidence framework was developed by MacKay, and MacKay has used it to the problem of regression, forward neural network and classification network. Provided data set D, a model 𝕄 with parameter vector w and a so-called hyperparameter or regularization parameter λ, Bayesian inference is constructed with 3 levels of inference:

In level 1, for a given value of λ, the first level of inference infers the posterior distribution of w by Bayesian rule p(w|D,λ,𝕄)∝p(D|w,𝕄)p(w|λ,𝕄). The second level of inference determines the value of λ, by maximizing p(λ|D,𝕄)∝p(D|λ,𝕄)p(λ|𝕄). The third level of inference in the evidence framework ranks different models by examining their posterior probabilities p(𝕄|D)∝p(D|𝕄)p(𝕄). 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}i=1N and the hyperparameters μ and ζ of the model 𝕄, the model parameters w and b are estimated by maximizing the posterior p(w,b|D,log⁡μ,log⁡ζ,𝕄). Applying Bayes’ rule, we obtain

… excerpt ends here. Continue reading the full article.

Illustrations

Least-squares support vector machine: The result of the SVM classifier
The result of the SVM classifier
Least-squares support vector machine: The result of the LS-SVM classifier
The result of the LS-SVM classifier

Worked examples

Example 1 — a first encounter with Least-squares support vector machine

Start with the simplest possible case. Write down what Least-squares support vector machine claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Least-squares support vector machine before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Least-squares support vector machine ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Least-squares support vector machine

In research
Least-squares support vector machine appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Least-squares support vector machine in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Least-squares support vector machine is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1999 in artificial intelligence, Classification algorithms, Kernel methods for machine learning, so understanding it makes those chapters shorter.
In everyday life
Look for Least-squares support vector machine outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Least-squares support vector machine” →

How to study Least-squares support vector machine in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Least-squares support vector machine means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Least-squares support vector machine out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Least-squares support vector machine in simple terms?

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 regressi…

Why does Least-squares support vector machine matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Least-squares support vector machine?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Least-squares support vector machine.

Tags

  • 1999 in artificial intelligence
  • Classification algorithms
  • Kernel methods for machine learning
  • Least squares
  • Regression analysis
  • Statistical classification
  • Support vector machines

Keep exploring