简体   繁体   English

在libsvm中训练时间并过度使用gamma和C

[英]training time and overfitting with gamma and C in libsvm

I am now using libsvm for support vector machine classifier with Gaussian kernal. 我现在使用libsvm与高斯内核一起支持向量机分类器。 In its website , it provides a python script grid.py to select the best C and gamma. 其网站上 ,它提供了一个python脚本grid.py来选择最佳的C和gamma。

I just wonder how training time and overfitting/underfitting change with gamma and C? 我只是想知道伽玛和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? 假设C从0变为+无穷大,则训练后的模型将从欠拟合变为过拟合,并且训练时间增加了吗?

suppose gamma changes from almost 0 to +infinity, the trained model will go from underfitting to overfitting, and the training time increases? 假设伽马从几乎0变为+无限大,训练后的模型将从不完全拟合变为过度拟合,并且训练时间增加了?

In grid.py, the default searching order is for C from small to big BUT gamma from big to small. 在grid.py中,默认的搜索顺序是C从小到大,但Gamma从大到小。 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? 这样我们也许可以节省选择C和gamma值的时间?

Thanks and regards! 谢谢并恭祝安康!

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? 这样我们也许可以节省选择C和gamma值的时间?

... I find that, with libsvm, there is definitely a "right" value for C and gamma that is highly problem dependent. ...我发现,使用libsvm,对于C和gamma来说,肯定存在高度依赖于问题的“正确”值。 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. 最终,我不知道此耗时的快捷方式(取决于您的问题),但需要进行参数搜索。

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

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