I'm using liblinear to classify documents. The input are arrays of tf-idf scores. Everything is working well, but now I'm trying to determine optimal parameters. I set up a loop of cross validation operations with cost incrementing from loop to loop. However, even over hundreds of iterations I see no effect from changing C. The results are all within 2% of each other, and vary so little that even just running a loop with a single C value can produce the same spread of results. What am I doing wrong or not understanding?

Note: I am using the Ruby binding for liblinear, not the command line tools or direct C code. That said the Ruby binding is a very, very small wrapper around the C library itself and works and acts exactly the same.

  • $\begingroup$ What values of $C$ are you examining? $\endgroup$ – Sycorax Feb 22 '18 at 16:55
  • $\begingroup$ Thanks for the response. I tried 1 through 1000. I'm a noob and don't have a good feeling for what range I should be using for C. I tried that range because the default is 1, so I assumed small whole integers made sense. $\endgroup$ – Adam Drew Feb 22 '18 at 18:08
  • $\begingroup$ This is a closely related question about choosing $C$ and $\gamma$ for a RBF SVM. stats.stackexchange.com/questions/43943/… The key take-away is (1) there's no reason that $C$ must be an integer (but $C$ must be positive) and (2) varying $C$ over orders of magnitude is more reasonable. $\endgroup$ – Sycorax Feb 22 '18 at 18:14
  • $\begingroup$ Also, your findings could be related to this well-known phenomenon. stats.stackexchange.com/questions/312780/… $\endgroup$ – Sycorax Feb 22 '18 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.