Solution (source code)

= Solution

Take labels $y_i\in\{-1,1\}$ and fix the standard normalization in which the squared weight penalty has coefficient $1/2$. The <squared-slack support vector machine>, a form of <soft-margin support vector machine>, has <primal problem>
$$
\boxed{\begin{aligned}
\underset{w,b,\xi}{\operatorname{minimize}}\quad&\frac12\|w\|^2+C\sum_{i=1}^m\xi_i^2,\\
\text{subject to}\quad&y_i(w\cdot x_i+b)\geq1-\xi_i,\qquad i=1,\ldots,m,\\
&\xi_i\geq0,\qquad i=1,\ldots,m.
\end{aligned}}
$$
The <slack variables of a support vector machine> permit margin violations. Penalizing $\|w\|^2$ favors a wide <support-vector-machine margin>, while $C>0$ sets the cost of the violations. The intercept $b$ is unpenalized, and the resulting <classifier> is $h(x)=\operatorname{sign}(w\cdot x+b)$, with a fixed choice at zero. The square on $\xi_i$ is essential to the <Lagrangian dual problem> below.