简体   繁体   English

分类得分:SVM

[英]Classification score: SVM

I am using libsvm for multi-class classification. 我使用libsvm进行多类分类。 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

You can use one vs all approach first and consider them as 2class classification by having the decision value option in the libSVM. 您可以首先使用one-all方法,并通过在libSVM中使用决策值选项将它们视为2类分类。 This is done by having the each class as positive class and rest of the class as negative for each classification. 这是通过将每个类作为正类和类的其余部分作为每个分类的否定来完成的。

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. 例如,样本1对于类1具有决策值0.54,对于类2具有0.64,对于类3具有0.43,对于类4具有0.80,然后可以将其分类为类4。

You can also use probability values to classify instead of decision function values by using -b option in libSVM. 您还可以使用概率值在libSVM中使用-b选项进行分类而不是决策函数值。

Hope this helps.. 希望这可以帮助..

Another option is to use the LIBLINEAR package which internally implements one-vs-all strategy for solving multi-class problem. 另一个选择是使用LIBLINEAR包,它在内部实现一对一策略来解决多类问题。 In LIBSVM, this implementation is based on one-vs-one strategy. 在LIBSVM中,此实现基于一对一策略。

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

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