libsvm以概率输出单个test样例的判别结果

在函数svmtrain和svmpredict的输入参数部分加入'-b 1'
比如原先是
svmtrain -c 8.0 -g 0.0078125 a1a.scale

  修改过后就是

svmtrain -b 1 -c 8.0 -g 0.0078125 a1a.scale

 这里的b参数到底是什么意思呢

svmtrain中的DOC:

-b probability_estimates : whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0)

svmpredict中的DOC:

-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); one-class SVM not supported yet

我理解的应该就是可以选择训练SVC或SVR模型,这种模型可以概率输出的意思。

如果train model的时候不加参数b,那么那种模型来predict会报错。

具体SVC和SVR模型参数的含义,接下来我会研究一下。

附svmtrain中关于 svm type参数s的DOC

-s svm_type : set type of SVM (default 0)
"
+"    0 -- C-SVC
"
+"    1 -- nu-SVC
"
+"    2 -- one-class SVM
"
+"    3 -- epsilon-SVR
"
+"    4 -- nu-SVR

我们默认不加-s -b,只用 -c -g训练出来的模型应该是C-SVC 嗯嗯 

迫不及待去看SVC和SVR到底是什么了 哈哈

============================================

(补充于2014.10.07)

用cg参数训练出来的是RBF核,在-t中可以选择核函数类型;

svr 支持向量回归(support vector regression) svc 支持向量分类器(support vector classifier)——百度知道;

原文地址:https://www.cnblogs.com/zklidd/p/3848219.html