Peiyun
Peiyun

Reputation: 171

The gamma and cost parameter of SVM

everybody, here is a weird phenomenon when I was using libSVM to make some predictions.

When I set no parameters of SVM, I will get a 99.9% performance on the testing set. While, if I set parameters '-c 10 -g 5', I will get about 33% precision on the testing set.

By the way, the SVM toolkit I am using is LibSVM.

I wonder if there is something wrong with data set. And I could not figure out which result is more convincing.

Upvotes: 2

Views: 11936

Answers (1)

Marc Claesen
Marc Claesen

Reputation: 17026

You just happen to have a problem for which the default values for C and gamma work well (1 and 1/num_features, respectively).

gamma=5 is significantly larger than the default value. It is perfectly plausible for gamma=5 to induce very poor results, when the default value is close to optimal. The combination of large gamma and large C is a perfect recipe for overfitting (e.g. high training set performance and low test set performance).

Upvotes: 11

Related Questions