$$w = \frac{2}{||\mathbf{W}||}.$$ The best classifier is obtained through maximizing this distance or minimizing $||\mathbf{W}||$ subject to the constraint in Equation (\[eqn:linsvmcon\]) since in this limit we will obtain the most robust separation of the datapoints. For computational purposes, we actually end up minimizing $\frac{1}{2}||\mathbf{W}||^2$. The optimization can be performed using Lagrange multipliers ($\alpha_i$). This leads to minimizing $||\mathbf{W}||$ with respect to the Lagrangian $$L(\alpha_i) = \frac{1}{2}||\mathbf{W}||^2 - \sum^{N}_{i=1}\alpha_i
[y_i(\mathbf{W} \cdot \mathbf{X}_i - b) - 1]
\label{eqn:lp}$$ subject to the constraints $\alpha_i \geq 0$. Taking the derivative of this Lagrangian with respect to $||\mathbf{W}||$ yields the solution $$||\mathbf{W}|| = \sum_{i=1}^{N} \alpha_i Y_i \mathbf{X}_i.$$ Values for the $\alpha_i$ can be obtained by substituting this solution back into Equation (\[eqn:lp\]) which yields $$L(\alpha_i) = \sum_{i=1}^{N} \alpha_i - \frac{1}{2}\sum^{N}_{i=1}
\sum^{N}_{j=1} \alpha_i \alpha_j Y_i Y_j \mathbf{X}_i \cdot \mathbf{X}_j
\label{eqn:ld}.$$ and maximizing $L(\alpha_i)$ with respect to the $\alpha_i$. It turns out that only a few of the $\alpha_i$ are non-zero. These correspond to the training points that satisfy the equality condition in Equation (\[eqn:linsvmcon\]). Such points are called the support vectors and set the value of $b$, i.e. ($b = \mathbf{W}\cdot\mathbf{X}_i - Y_i$). In practice, $b$ is taken to be an average over the support 