SVM predict multiclass
Im curious about how to go about using the predict method in SVM for a multi class object detector using BoF and SIFT.
Ive trained the svm with 8 classes, and when I call predict it determines the class label. Thats all well and good but I am trying to determine the probability. I am reading video frames and each frame is so closely related that the label alone will not help.
I need to figure out how to calculate the probability so that I can choose the closest match possible after reading all of the frames.
I am looking into getDecisionFunction but the result is always the same (0.986196) for each frame in the video that I am using the SVM to predict.
Is there a step that I need to take in order to fetch the probability of the prediction?
I am using openCV 3.1 if this helps.
Thanks, John
Afaik, there is no out-of-box way to get multiclass probability in OpenCV (it can be retrieved in a 2-class classification problem though)
Yeah, that is what I thought too, but then I found this post which got me thinking that it is. I could not find this line of code in the opencv 3.1 file mentioned but I DID find getDecisionFunction method. Im just not sure how to use it, its a bit over my head.
Im trying to detect multiple positions of one human in a video. Someone told me a multi class SVM is the way to go, and I have the code working, just doesn't give probability...so this method is moot if I can't get that. When I run the video it will classify the first 100 frames as "1" the next 100 as "2", and so forth. I just need the BEST match for each class that I train in the SVM.