How to describe Support Vector Machine formula onto the Quadratic Programming objective function?

42 Views Asked by At

enter image description here

Assume that we have two lines. Green and blue line.

$$w^Tx - b = 1$$ $$w^Tx - b = -1$$

Our goal is to find $w$ and $b$ here.

The first we can do, is to find the distance between these two lines.

We first find the ratio between $x^+$ and $x^−$. They are coordinates of $x$ that can describe

$$w^Tx^+ - b = 1$$ $$w^Tx^− - b = -1$$

So $x \in x^+, x^−$

The ratio between $x^+$ and $x^−$ is

$$x^+ = x^− + \lambda w$$

Where $\lambda$ is the distance between the two lines. If we using

$$w^Tx^+ - b = 1$$

and add in

$$x^+ = x^− + \lambda w$$

We will get this:

$$w^T(x^− + \lambda w) - b = 1$$ $$w^Tx^− + \lambda w^Tw - b = 1$$

And notice that $w^Tx^− -b$ is $-1$

$$-1 +\lambda w^Tw = 1$$

And now it will become

$$\lambda w^Tw = 2$$

We want to have the distance by it self

$$\lambda = \frac{2}{w^Tw}$$

And we need to make sure that $\lambda$ is always a positive number, so we are taking $$||\lambda|| = \frac{||2||}{||w||} = \frac{2}{||w||}$$

Question:

The number $||\lambda||$ need to be equal to 2, then the lines is optimized. Because the perdendicular distance between these two lines are 2.

The quadratic programming problem is:

$$\frac{1}{2}w^TQw + c^Tw$$

Where the constraints are:

$$Aw \leq d$$ $$w \geq 0$$

How can I describe the support vector machine formula, onto the quadratic programming objective function?