如何计算 libsvm 中的最佳 C / Gamma 参数?

发布于 2024-08-31 07:58:34 字数 357 浏览 3 评论 0原文

我使用 libsvm 进行多类分类具有大量特征/属性的数据集(每个项目大约 5,800 个)。我想为 C 和 Gamma 选择比我当前使用的默认值更好的参数。

我已经尝试过运行 easy.py,但对于我正在使用的数据集,估计时间几乎是永远的(在 20、50、100 和 200 个数据样本下运行 easy.py,并得到了一个超线性回归,该回归预测我必要的运行时间需要数年)。

有没有办法比默认值更快地获得更好的 C 和 Gamma 值?我正在使用 Java 库,如果这有什么区别的话。

I'm using libsvm for multi-class classification of datasets with a large number of features/attributes (around 5,800 per each item). I'd like to choose better parameters for C and Gamma than the defaults I am currently using.

I've already tried running easy.py, but for the datasets I'm using, the estimated time is near forever (ran easy.py at 20, 50, 100, and 200 data samples and got a super-linear regression which projected my necessary runtime to take years).

Is there a way to more quickly arrive at better C and Gamma values than the defaults? I'm using the Java libraries, if that makes any difference.

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

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

发布评论

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

评论(1

皇甫轩 2024-09-07 07:58:34

无需网格搜索就可以完成此任务,正如我相信 easy.py 所做的那样。

请参阅 Trevor Hastie 等人的这篇论文:支持的整个正则化路径向量机 (PDF)。一次“SVM 运行”将一次性计算所有“C”值的损失,因此您可以了解它如何影响您的 SVM 性能。

他们有这个算法的实现,您可以通过 svmpath 包。

我相信该算法的核心是用 Fortran 编写的,但封装在 R 中。

It's possible to accomplish this without a grid search, as I believe easy.py does.

Look at this paper from Trevor Hastie, et al: The Entire Regularization Path for the Support Vector Machine (PDF). One "SVM run" will calculate the loss for all values of "C" in one shot, so you can see how it effects your SVM performance.

They have an implementation of this algorithm that you can use in R through the svmpath package.

I believe the core of the algorithm is written in fortran, but is wrapped in R.

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