Understanding SVM geometrically

62 Views Asked by At

I have a question about SVM. I learned that the dot product of w*x is the projection of x on w. Therefore, as I understand it, wx-b=1 is the line which consists of all the points with a projection of length 1 on w, and the same applies to the other line: wx-b=-1, just from the opposite direction of w. However, if that's the case, then it seems that the distance between the two lines is a constant which equals 1+1=2. That contradicts the fact that we wish to maximize the margin. What am I missing here?

illustration

1

There are 1 best solutions below

0
On

You forgot to consider the unit direction.

$$w^Tx=b$$

or equivalently,

$$\frac{w^Tx}{\|w\|}=\frac{b}{\|w\|}$$

tells us that the projection of $x$ onto the direction $\frac{w}{\|w\|}$ is $\frac{b}{\|w\|}$.

$$\frac{b+1}{\|w\|}-\frac{b-1}{\|w\|}=\frac2{\|w\|}$$