Based on the readme file in the libsvm package. The svmpredict matlab version function is used in the following way:

[predicted_label, accuracy, decision_values/prob_estimates] =
svmpredict(testing_label_vector, testing_instance_matrix, model [,

The return value "accuracy" is always a three dimension vector. The first element in the vector is the classification accuracy. What are the other two?

Can I use the decision_values as the confidence score? Or prob_estimates?

Thanks so much.


1 Answer 1


If you read down in the README a bit:

Result of Prediction

The function 'svmpredict' has three outputs. The first one, predictd_label, is a vector of predicted labels. The second output, accuracy, is a vector including accuracy (for classification), mean squared error, and squared correlation coefficient (for regression).

If you're doing classification, you should only care about the first component.

decision_values are confidence scores, by definition. They represent how far past the margin the test points lie. prob_estimates, when using -b 1 in the libsvm_options to turn them on, are monotonic transformations of decision values (which can be any real number, where 0 is the dividing line between the classes) to probabilities (between 0 and 1, with 0.5 the dividing line).

  • $\begingroup$ Exactly this. The manual is clear about these things (+1). $\endgroup$ Feb 26, 2015 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.