I am trying to solve the SVM Primal formula in MATLAB using the Quadprog function. When the two classes are linearly separated, the problem of minimizing the SVM to obtain the weight vector w becomes 1/2 (|| W || 2)
subject to the constraint yi (wxi-b)> = 1
http://en.wikipedia.org/wiki/Support_vector_machine#Primal_form
Matlab's quadrupole function solves the following equation
x = quadprog (H, f, A, b) minimizes 1/2 * x '* H * x + f' * x subject to the constraints A * x β€ b. A is the twin matrix, b is the twin vector.
So, the primary form can easily be mapped onto a quadruple function in order to easily obtain the weight vector w. H becomes the identity matrix. f 'becomes a matrix of zeros. A - the left side of the constraint from previously b is -1, since the original constraint has> = 1, it becomes <= -1 when we multiply with -1 on both sides.
When I do this, the weight vector is great.
Now I am trying to solve the case with the soft SVM field here
http://en.wikipedia.org/wiki/Support_vector_machine#Soft_margin
Minimization equation here
min ((1/2) || w || 2 + C (summation epsilon (i)) w, b
subject to the constraint yi (wxi-b)> = 1 - eplison (i)> = 0.
How to solve this optimization problem using the Quadprog MATLAB function. It is unclear how the equation should be matched with the parameters of the quadprog function. I split my head about how unlucky.
It has been a long time since I learned SVM, but due to vague memory, I remember that Primal Form in the Soft Margin is an NP problem, so we convert it to Wolfe's double representation to solve it, but I'm not sure .
I converted it to double form and I can get the values ββof the Lagrange variable in double form, however I want to confirm that the primary form cannot be solved on its own.
Does anyone know how this can be solved using the matlab quadprog function? Or if it is an NP problem?