Solving the SVM problem by inspection
By inspection we can see that the boundary decision line is the function . Using the formula
we can obtain a first guess of the parameters as
Using these values we would obtain the following width between the support vectors: . Again by inspection we see that the width between the support vectors is in fact of length
meaning that these values are incorrect.
Recall that scaling the boundary by a factor of does not change the boundary line, hence we can generalize the equation as
$$ cx_1 - xc_2 - 3c = 0$$
Plugging back into the equation for the width we get
\begin{aligned} \frac{2}{||w||} & = 4 \sqrt{2} \\ \frac{2}{\sqrt{2}c} & = 4 \sqrt{2} \\ c = \frac{1}{4} \end{aligned}
Hence the parameters are in fact
To find the values of we can use the following two constraints which come from the dual problem:
And using the fact that for support vectors only (i.e. 3 vectors in this case) we obtain the system of simultaneous linear equations:
\begin{aligned}
\begin{bmatrix} 6 \alpha_1 - 2 \alpha_2 - 3 \alpha_3 \\ -1 \alpha_1 - 3 \alpha_2 - 4 \alpha_3 \\ 1 \alpha_1 - 2 \alpha_2 - 1 \alpha_3 \end{bmatrix} & = \begin{bmatrix} 1/4 \\ -1/4 \\ 0 \end{bmatrix}
\\
\alpha & = \begin{bmatrix} 1/16 \\ 1/16 \\ 0 \end{bmatrix}
\end{aligned}
Source
- https://ai6034.mit.edu/wiki/images/SVM_and_Boosting.pdf
- Full post here
Solving the SVM problem by inspection
By inspection we can see that the boundary decision line is the function . Using the formula
we can obtain a first guess of the parameters as
Using these values we would obtain the following width between the support vectors: . Again by inspection we see that the width between the support vectors is in fact of length
meaning that these values are incorrect.
Recall that scaling the boundary by a factor of does not change the boundary line, hence we can generalize the equation as
$$ cx_1 - xc_2 - 3c = 0$$
Plugging back into the equation for the width we get
\begin{aligned} \frac{2}{||w||} & = 4 \sqrt{2} \\ \frac{2}{\sqrt{2}c} & = 4 \sqrt{2} \\ c = \frac{1}{4} \end{aligned}
Hence the parameters are in fact
To find the values of we can use the following two constraints which come from the dual problem:
And using the fact that for support vectors only (i.e. 3 vectors in this case) we obtain the system of simultaneous linear equations:
\begin{aligned}
\begin{bmatrix} 6 \alpha_1 - 2 \alpha_2 - 3 \alpha_3 \\ -1 \alpha_1 - 3 \alpha_2 - 4 \alpha_3 \\ 1 \alpha_1 - 2 \alpha_2 - 1 \alpha_3 \end{bmatrix} & = \begin{bmatrix} 1/4 \\ -1/4 \\ 0 \end{bmatrix}
\\
\alpha & = \begin{bmatrix} 1/16 \\ 1/16 \\ 0 \end{bmatrix}
\end{aligned}
Source
- https://ai6034.mit.edu/wiki/images/SVM_and_Boosting.pdf
- Full post here
Instead of computing the width between the support vectors (which in this case was easy because two of them happened to be directly across from each other over the decision line), it might be more convenient to use that the support vectors should have value under the decision function:
$$ cx_1 - cx_2 -3c =0 $$
represents the line, but using the point with target
in the diagram, we should have
and hence (again) .



