Squared-slack support vector machine (source code)

= Squared-slack support vector machine
{title2=$\min_{w,b,\xi\geq0}\tfrac12\|w\|^2+C\sum_i\xi_i^2$}

The squared-slack <support vector machine> uses constraints $y_i(w\cdot x_i+b)\geq1-\xi_i$. With an unpenalized intercept, its <Lagrangian dual problem> maximizes $\sum_i\alpha_i-\tfrac12\sum_{i,j}\alpha_i\alpha_jy_iy_jK(x_i,x_j)-\tfrac1{4C}\sum_i\alpha_i^2$ subject to $\alpha_i\geq0$ and $\sum_i\alpha_i y_i=0$. The square adds a diagonal penalty in the dual rather than a finite upper box constraint. The <Karush-Kuhn-Tucker conditions> give $w=\sum_i\alpha_i y_i\phi(x_i)$ and $\xi_i=\alpha_i/(2C)$ for a <feature map> realizing the <positive-semidefinite kernel> $K$.