libsvm 中 gamma 和 C 的训练时间和过度拟合

发布于 2024-08-21 18:13:09 字数 432 浏览 5 评论 0原文

我现在使用 libsvm 进行高斯核的支持向量机分类器。在其网站中,提供了一个python脚本grid.py来选择最好的 C 和伽马值。

我只是想知道训练时间和过拟合/欠拟合如何随 gamma 和 C 变化?

是否正确的是:

假设C从0变为+无穷大,训练后的模型会从欠拟合变为过拟合,并且训练时间增加?

假设gamma从几乎0变为+无穷大,训练后的模型会从欠拟合变为过拟合,并且训练时间增加?

在grid.py中,默认的搜索顺序是C从小到大,但gamma从小到小。是为了训练时间从小到大,训练模型从欠拟合到过拟合吗?那么我们也许可以节省选择 C ​​和 gamma 值的时间?

谢谢和问候!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赠意 2024-08-28 18:13:09

这是个好问题,但我没有确定的答案,因为我自己也想知道。但在回答问题时:

那么我们也许可以节省选择 C ​​和 gamma 值的时间?

...我发现,使用 libsvm,C 和 gamma 肯定有一个“正确”值,该值高度依赖于问题。因此,无论搜索 gamma 的顺序如何,都必须测试 gamma 的许多候选值。最终,我不知道有什么捷径可以解决这个耗时的(取决于您的问题)但必要的参数搜索。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文