简体   繁体   English

如何在训练svm模型时调整参数

[英]How to adjust parameters when training a svm model

If I using rbf as the kernel function, then two parameters( c and g ) has to be adjusted. 如果我使用rbf作为内核函数,则必须调整两个参数( cg )。 I can search every parameter pair( ci , gi ),and select the best pair. 我可以搜索每个参数对( cigi ),并选择最佳对。 Is there any better approach to find the best parameters. 有没有更好的方法来找到最好的参数。

The highlight from this blog on the kernel width choice : 这个博客关于内核宽度选择的亮点:

在此输入图像描述

To pick, say 1000 pairs (x,x’) at random from your dataset, compute the distance
of all such pairs and take the median, the 0.1 and the 0.9 quantile. Now pick λ 
to be the inverse any of these three numbers. With a little bit of cross 
validation you will figure out which one of the three is best. In most cases you 
won’t need to search any further.

And this post from cross validated provides an analysis on the reason why such method works well. 交叉验证的这篇文章分析了这种方法运作良好的原因。 Basically changing the decision function for all or only one datapoint is avoided. 基本上可以避免改变所有或仅一个数据点的决策函数。

Besides, you may search "Heuristic method" on the parameter choice in SVM. 此外,您可以在SVM中的参数选择中搜索“启发式方法”。 For example, in M.Boardman et al's A Heuristic for Free Parameter Optimization with Support Vector Machines , the authors applied simulated annealing to improve parameter search efficiency compared to an exhaustive grid search. 例如,在M.Boardman等人的A Heuristic for Free Parameter Optimization with Support Vector Machines中 ,作者应用模拟退火来提高参数搜索效率,与穷举网格搜索相比。

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

相关问题 如何更改保存的 model 的参数,而无需在 Gensim Doc2Vec 中训练文档? - How to change parameters of saved model without training docs in Gensim Doc2Vec? 如何调整代码以使用两个参数而不是一个? - How can I adjust code to work with two parameters instead of one? SVM模型偏差的负号 - Negative sign of the bias of a SVM model 如何在字典中存储 model + 参数? - How to store a model + parameters in a dictionary? libSVM中SVM模型训练输出的含义是什么 - What are the meaning of SVM model train output in libSVM 在Rails和minitest中,模拟模型的POST创建请求时如何命名参数? - In Rails and minitest, how do I name my parameters when simulating a POST create request for my model? 如何以编程方式配置模型参数的可调性? - How to programmatically configure the tunability of model parameters? 如何读取 Wagtail model 中的 URL 参数? - How to read URL parameters in a Wagtail model? 如何获得 PyTorch 模型参数的平面视图? - How to get a flattened view of PyTorch model parameters? SQL:如何根据传递的参数有条件地调整WHERE子句,并且仍然可以与UNION一起使用 - SQL: How To Conditionally Adjust the WHERE Clause Depending on Passed Parameters and still work with UNION
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM