I have a data set with 36000 rows and 9 columns. so n<< m. this is multi classification SVM. I solved this by primal model in OSQP. then I used R package e710 and svm with linear kernel.

the accuracy of these 2 result is very different. linear kernel is much better than primal model,

I can't understand why!shouldn't they to be the same or close? how we can improve accuracy of primal model?

How was my primal model?

1- I didn't use kernel in primal. It was original model:

min $WW^{T}+C epsilon$


$y(WX+b)>= 1 - epsilon$

$epsilon >=0$

this is a quadratic program and I solve it by OSQP. I tried different cost for epsilon: 8,10,20, even 100

checking accuracy:

I used a simple prediction model. from the above model we can find W and then predict :


since there are 3 classes, we choose the highest f(x).

  • $\begingroup$ Do you have 36000 data points and 9 dimensions, or the other way around? $\endgroup$
    – user20160
    Aug 25, 2019 at 13:02
  • $\begingroup$ right 9 features $\endgroup$
    – sherek_66
    Aug 25, 2019 at 13:13
  • 1
    $\begingroup$ When you say 'solved by primal model' do you mean ordinary, linear (non-kernelized) SVM? Did you use hard or soft margin SVMs (and was this the same in both cases)? If soft margin, how did you set the regularization parameter in each case? How did you measure the accuracy in each case, and what exactly was it? Perhaps you could edit the question to include these details. $\endgroup$
    – user20160
    Aug 25, 2019 at 13:18
  • $\begingroup$ I will edit my post to answer all of your questions. $\endgroup$
    – sherek_66
    Aug 25, 2019 at 13:39
  • $\begingroup$ @user20160 I didn't write details that how I wrote my model as a multi classification. I meant how the indices must be $\endgroup$
    – sherek_66
    Aug 25, 2019 at 13:48


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.