如何在Libsvm模型中安排支持向量?

时间:2016-02-23 15:06:49

标签: matlab machine-learning svm libsvm supervised-learning

我想使用从Libsvm模型派生的参数来预测新数据(不在matlab中)。我想问一下模型中的支持向量(nSV,sv_coef,SVs)是否按照模型中Label的顺序排列?下面是使用线性核从fisheriris导出的模型,Label是[3; 2; 1]所以这意味着nSV,sv_coef,SVs的顺序是[class3; class2; class1]? enter image description here

1 个答案:

答案 0 :(得分:1)

确实是的。我一直在做类似的实验,我的结果是

enter image description here

看起来前三个SV来自1级。从SV索引字段我得到了

enter image description here

通过查看标签向量中的这些索引,我得到了:

enter image description here enter image description here

第24,25和42种模式确实有标签1。

第4个SV指数是53,相反,标签2 ......依此类推。

相关问题