Classification score: SVM
Asked Answered
B

2

7

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
Boarer answered 18/6, 2011 at 12:26 Comment(1)
I do not want a single class id as the classification output. Rather the output should be like: the given sample can be classified to class1 with probability score1.Boarer
N
6

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.

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.

You can also use probability values to classify instead of decision function values by using -b option in libSVM.

Hope this helps..

Needham answered 19/6, 2011 at 4:27 Comment(1)
Normalizing the distance to the hyperplane isn't always a good measurement of probability of belonging to a class. See this paper by Zadrozny and Elkan.Cowhide
D
2

Another option is to use the LIBLINEAR package which internally implements one-vs-all strategy for solving multi-class problem. In LIBSVM, this implementation is based on one-vs-one strategy.

Dermatologist answered 12/2, 2012 at 0:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.