Solution (source code)

= Solution

Fix $C>0$ and use the unnormalized sum convention for the penalty. The linear <soft-margin support vector machine> solves
$$
\boxed{\min_{w,b,\xi}\left\{\frac12\lVert w\rVert_2^2+C\sum_{i=1}^n\xi_i\right\}\quad\text{subject to}\quad y_i(w^Tx_i+b)\geq1-\xi_i,\quad\xi_i\geq0.}
$$
Eliminating the <slack variables of a support vector machine> gives $\frac12\lVert w\rVert^2+C\sum_i\max\{0,1-y_if(x_i)\}$, where $f(x)=w^Tx+b$ and the maximum is the <hinge loss>. The classifier uses the sign of $f$ and its <support-vector-machine decision boundary> is $f=0$.

For clarity about <dual support vectors and margin degeneracy>, let $\alpha_i$ be the multipliers of the margin constraints. The <Karush-Kuhn-Tucker conditions> give
$$
w=\sum_i\alpha_iy_ix_i,\qquad\sum_i\alpha_iy_i=0,\qquad0\leq\alpha_i\leq C,
$$
$$
\alpha_i\{y_if(x_i)-1+\xi_i\}=0,\qquad(C-\alpha_i)\xi_i=0.
$$
The dual <support vectors> are those with $\alpha_i>0$. A coefficient strictly between $0$ and $C$ puts a point exactly on its margin boundary; a point with positive slack has $\alpha_i=C$. A zero coefficient implies zero slack and signed margin at least one. Geometrically one often counts all points with $y_if(x_i)\leq1$ as <support vectors>. At a degeneracy, equality can occur with $\alpha_i=0$, so the two descriptions need not coincide. Either convention supports the bound in the following part when stated consistently.