简体   繁体   English

SVM的gamma和cost参数

[英]The gamma and cost parameter of SVM

everybody, here is a weird phenomenon when I was using libSVM to make some predictions. 大家,这是一个奇怪的现象,当我使用libSVM做一些预测时。

When I set no parameters of SVM, I will get a 99.9% performance on the testing set. 当我没有设置SVM参数时,我将在测试集上获得99.9%的性能。 While, if I set parameters '-c 10 -g 5', I will get about 33% precision on the testing set. 然而,如果我设置参数'-c 10 -g 5',我将在测试集上获得大约33%的精度。

By the way, the SVM toolkit I am using is LibSVM. 顺便说一下,我使用的SVM工具包是LibSVM。

I wonder if there is something wrong with data set. 我想知道数据集是否有问题。 And I could not figure out which result is more convincing. 我无法弄清楚哪个结果更有说服力。

You just happen to have a problem for which the default values for C and gamma work well (1 and 1/num_features, respectively). 你碰巧遇到了一个问题, Cgamma的默认值都能正常工作(分别为1和1 / num_features)。

gamma=5 is significantly larger than the default value. gamma=5明显大于默认值。 It is perfectly plausible for gamma=5 to induce very poor results, when the default value is close to optimal. 当默认值接近最优时, gamma=5导致非常差的结果是完全合理的。 The combination of large gamma and large C is a perfect recipe for overfitting (eg high training set performance and low test set performance). gamma和大C的组合是过度拟合的完美配方(例如,高训练集性能和低测试集性能)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM