0

I've trained a two-class SVM, one for Accept and one for Reject. In my application, I'd rather have false acceptance then a false rejection. So I think I'd like to calculate a confidence score and empirically choose a threshold which is biased toward acceptance. The following thread discussed using SVM.decision_func directly with the support vector: Obtaining weights in CvSVM, the SVM implementation of OpenCV

But I'm not sure how to put it all together, particularly using the support vector with the actual test feature matrix to calculate a final scalar confidence score. How do I do that?

Thanks.

Community
  • 1
  • 1
jacob
  • 2,762
  • 1
  • 20
  • 49

1 Answers1

1

just call CvSVM::predict with the returnDFVal param set to true, and it will return distances instead of class-labels

berak
  • 39,159
  • 9
  • 91
  • 89
  • Thanks! I didn't know it was so obvious! ... It does seem that the decision value is opposite of the class label value. That is, if Accept=1 and Reject=-1, I'm seeing that the decision value of Accept is less than 0, and the decision value of Reject is greater than 0. Does that make sense? – jacob Nov 07 '14 at 18:25