I’ve been trying to implement the soft-margin, polynomial kernel svm dual problem in svm. As people already know, the dual variable values I should be getting is 0, C (soft margin cost), or sth in between. When I do the original Kernel (x’x) I get these values, however if I use the polynomial or RBF kernel, the alphas are all in the 0 < alpha < C range. None of them are 0 or C. Does anyone know why? I’ve tried alternating the parameters, too. Just in case, here is my code:
cvx_begin
variables alpha(m);
minimize (0.5.*alpha'*Q*alpha - ones(m,1)'*alpha);
subject to
alpha >= 0;
alpha <= C;
Y'*alpha == 0;
cvx_end
where Q is a matrix I calculate beforehand with the Kernel function.