I am developing a image-classification project using BOW model and SVM. I want to find out the SVMs predict probability but there is no such function in opencv svm. Is there any way to do this? I want to find out the predict probability in n-class SVM.
One standard way to obtain a “probability” out of an SVM is to use Platt scaling, which is available in many decent SVM implementations. In the binary case, the probabilities are calibrated using Platt scaling: logistic regression on the SVM's scores, fit by an additional cross-validation on the training data.
SVMs do not directly provide probability estimates, these are calculated using an expensive five-fold cross-validation (see Scores and probabilities, below).
No you can't do this with CvSVM. OpenCV's SVM implementation is based on a very old version of libsvm. Download the latest version of libsvm and use it instead. Of course you will have to write a wrapper to convert data formats. See http://www.csie.ntu.edu.tw/~cjlin/libsvm/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With