训练SVM的参数是什么 [英] What are the parameters for training SVM
问题描述
我正在使用该库
它指出 C
定义了错误分类和边际之间的权衡.必须根据您的数据选择足够大的值.您还将在这里看到 eps> 0
参数.这可能是您的 tolerance
参数,并定义了目标函数中由 C
参数加权的的误差.
对于内核参数
,请看一下 SVM
的双重问题:
您会看到术语 K(x_i,x_j)
.这称为内核功能
.该功能允许SVM学习非线性决策边界.因此,如果您的数据不是线性可分割的,则可以使用这样的函数将数据(实际上是 dot-product
)转换为更高维度的特征空间,以将其分离.只需看一下本指南,它将教您有关SVM培训过程的基础知识和一些最佳实践:
https://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf
I'm doing software using machine learning with SVM using this library https://www.npmjs.com/package/machine_learning
according to the example of SVM:
svm.train({
C : 1.1, // default : 1.0. C in SVM.
tol : 1e-5, // default : 1e-4. Higher tolerance --> Higher precision
max_passes : 20, // default : 20. Higher max_passes --> Higher precision
alpha_tol : 1e-5, // default : 1e-5. Higher alpha_tolerance --> Higher precision
kernel : { type: "polynomial", c: 1, d: 5}
// default : {type : "gaussian", sigma : 1.0}
// {type : "gaussian", sigma : 0.5}
// {type : "linear"} // x*y
// {type : "polynomial", c : 1, d : 8} // (x*y + c)^d
// Or you can use your own kernel.
// kernel : function(vecx,vecy) { return dot(vecx,vecy);}
});
the parameter C tells the SVM optimization how much you want to avoid misclassifying each training example.
I do not understand the other parameters.
Just take a look at the equation of the soft-margin C-SVM
:
It points out that C
defines the trade-off between missclassifications and margin. This must be choosen sufficiently large depending on your data. What you'll also see here is the eps>0
parameter. This could possibly be your tolerance
parameter and defines the error to the which is weighted by C
parameter in the objective function.
For the kernel parameters
, take a look at the dual problem for the SVM
:
You'll see the term K(x_i,x_j)
. This is called the Kernel-Function
. This function allows the SVM to learn non-linear descision boundaries. So if your data is not linearly separatable, you can use such a function to tranform your data, actually it's dot-product
, into an higher dimensional feature space to separate them there. Just take a look at this guide, it will teach you the basics about the training process of an SVM and some best practices:
https://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf
这篇关于训练SVM的参数是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!