Consider the two-class classification problem using linear models of the form

$$ y(\bold x)=\bold w^{\text T}\bm\phi(\bold x)+b $$

where $\bm\phi(\bold x)$ denotes a fixed feature-space transformation. The training data set comprises $N$ input vectors $\bold x_1,\ldots,\bold x_N$, with corresponding target values $t_1,\ldots,t_N$ where $t_n\in\{-1,1\}$, and new data points $\bold x$ are classified according to the sign of $y(\bold x)$.

We shall assume for the moment that the training data set is linearly separable in feature space, so that $t_ny(\bold x_n)>0$ for all training data points. We should try to find the solution that will give the smallest generalization error. The support vector machine approaches this problem by maximizing the margin, which is defined to be the smallest distance between the decision boundary and any of the samples.

The perpendicular distance of a point $\bold x$ from a hyperplane defined by $y(\bold x)=0$ is given by $|y(\bold x)|/\|\bold w\|$. Thus using the rescaling parameters, we can consider the maximum margin solution is

$$ \argmin_{\bold w,b}\frac{1}{2}\|\bold w\|^2 $$

subject to the constraints given by

$$ t_n(\bold w^{\text T}\bm\phi(\bold x_n)+b)\geqslant1, \quad n=1,\ldots,N $$

This is an example of an quadratic programming problem in which we are trying to minimize a quadratic function subject to a set of linear inequality constraints.

In order to solve this constrained optimization problem, we introduce Lagrange multipliers $a_n\geqslant0$, giving the Lagrangian function

$$ L(\bold w,b,\bold a)=\frac{1}{2}\|\bold w\|^2-\sum_{n=1}^Na_n\{t_n(\bold w^{\text T}\bm\phi(\bold x_n)+b)-1\} $$

where $\bold a=(a_1,\ldots,a_N)^{\text T}$. We are minimizing with respect to $\bold w$ and $b$, and maximizing with respect to $\bold a$. Setting the derivatives of $L(\bold w,b,\bold a)$ with respect to $\bold w$ and $b$ equal to zero, we obtain the following two conditions

$$ \begin{aligned} \bold w&=\sum_{n-1}^N a_nt_n\bm\phi(\bold x_n)\\ 0&=\sum_{n=1}^Na_nt_n \end{aligned} $$

These give the dual representation of the maximum margin problem in which we maximize

$$ \tilde L(\bold a)=\sum_{n=1}^Na_n-\frac{1}{2}\sum_{n=1}^N\sum_{m=1}^Na_na_mt_nt_mk(\bold x_n,\bold x_m) $$

with respect to $\bold a$ subject to the constraints

$$ \begin{aligned} a_n&\geqslant0,\quad n=1,\ldots,N,\\ \sum_{n=1}^Na_nt_n&=0 \end{aligned} $$

Here the kernel function is defined by $k(\bold x,\bold x^\prime)=\bm\phi(\bold x)\bm\phi(\bold x^\prime)$.

In order to classify new data points using the trained model, we evaluate the sign of $y(\bold x)$ and we can expressed by

$$ y(\bold x)=\sum_{n=1}^Na_nt_nk(\bold x,\bold x_n)+b $$