views:

275

answers:

1

Hi,

I am now using libsvm for support vector machine classifier with Gaussian kernal. In its website, it provides a python script grid.py to select the best C and gamma.

I just wonder how training time and overfitting/underfitting change with gamma and C?

Is it correct that:

suppose C changes from 0 to +infinity, the trained model will go from underfitting to overfitting, and the training time increases?

suppose gamma changes from almost 0 to +infinity, the trained model will go from underfitting to overfitting, and the training time increases?

In grid.py, the default searching order is for C from small to big BUT gamma from big to small. Is it for the purpose of training time from small to big and trained model from underfitting to overfitting? So we can perhaps save time in selecting the values of C and gamma?

Thanks and regards!

+1  A: 

Good question for which I don't have a sure answer, because I myself would like to know. But in response to the question:

So we can perhaps save time in selecting the values of C and gamma?

... I find that, with libsvm, there is definitely a "right" value for C and gamma that is highly problem dependent. So regardless of the order in which gamma is searched, many candidate values for gamma must be tested. Ultimately, I don't know any shortcut around this time-consuming (depending upon your problem) but necessary parameter search.

Steve
There is a shortcut around the time-consuming parameter search. There is an R package called "svmpath" which computes the entire regularization path for a 2-class SVM classifier in one go. There is a link to the paper that describes what it's doing. See here: http://cran.r-project.org/web/packages/svmpath/index.html
Steve Lianoglou
Thanks for the reference; I've never used R, but I'm interested to see if it works. Do you know if it can find the best parameters for a multiple class SVM? (I know libsvm uses one-vs-one by default.) I read svmpath.pdf, but I don't see anything there about the multiple-class extension. I have between 10 to 24 classes in a current classification problem, thousands of data points, and 32 to 64 features. This parameter search sometimes takes me a very long time!
Steve