分类得分:SVM [英] Classification score: SVM
问题描述
我正在使用libsvm进行多类分类.如何附加分类分数以比较分类的置信度与给定样本的输出,如下所示:
I am using libsvm for multi-class classification. How can I attach classification scores, to compare the confidence of classification, with the output for a given sample as:
Class 1: score1
Class 2: score2
Class 3: score3
Class 4: score4
推荐答案
通过在libSVM中具有决策值选项,您可以首先使用一种对所有方法,并将它们视为2类分类.这是通过将每个类别的每个类别都设为肯定类别,而将其余类别的每个类别设为否定类别来实现的.
You can use one vs all approach first and consider them as 2class classification by having the decision value option in the libSVM. This is done by having the each class as positive class and rest of the class as negative for each classification.
然后比较结果的决策值以对样本进行分类.就像您可以将样本分配给决策值最高的类别.例如,样本1的类别1的决策值为0.54,类别2的决策值为0.64,类别3的决策值为0.43,类别4的决策值为0.80,则可以将其分类为类别4.
Then compare the decision values of the results to classify the samples. Like you can assign the sample to the class which has the highest decision values. For example, sample 1 has decision value 0.54 for class 1, 0.64 for class 2, 0.43 for class 3 and 0.80 for class4, then you can classify it to class4.
您还可以通过使用libSVM中的-b选项,使用概率值来分类而不是决策函数值.
You can also use probability values to classify instead of decision function values by using -b option in libSVM.
希望这会有所帮助.
这篇关于分类得分:SVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!