简体   繁体   English

为什么在Matlab中将预计算内核与libsvm一起使用

[英]why using precomputed kernels with libsvm in matlab

I am new to MATLAB and to LIBSVM. 我是MATLAB和LIBSVM的新手。 I got the fact that to use precomputed kernel, you must include sample serial number as the first column of the training and testing data. 我知道要使用预先计算的内核,必须将样本序列号作为训练和测试数据的第一列。 But importantly what I don't understand is: why would I use precomputed kernels? 但重要的是,我不了解的是:为什么要使用预先计算的内核? I am following the script described in LIBSVM and got results for linear and RBF but do not understand the need to use precomputed kernels. 我遵循LIBSVM中描述的脚本,并获得了线性和RBF的结果,但不了解使用预计算内核的需要。

Whether you need precomputed kernels depends on your metrics of input vectors. 是否需要预先计算的内核取决于输入向量的指标。 Sometimes you may need a different similarity function other than the norm-2 Euclidean distance or the radial basis function between a given feature to all the features from training set. 有时,除了给定特征与训练集中所有特征之间的范数2欧几里得距离或径向基函数之外,您可能需要其他相似性函数。

It is also possible that you need a multiplicative kernel (for example the product of two different kernel functions), which is not feasible by choosing one kernel type from Libsvm. 您还可能需要一个乘法内核(例如,两个不同内核函数的乘积),这是无法通过从Libsvm中选择一种内核类型来实现的。 Then writing a precomputed kernel is a good option. 然后编写一个预先计算的内核是一个不错的选择。

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

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