The sign in CvSVM::predict [closed]
Hi all,,
I'm using a binary SVM to classify positive and negative sets of images encoded using HOG descriptors to the machine; I labeled my positive set '1' and '0' for the negative one during training.
Based on the OpenCV manual, using float response = predict(inputMat, true);
returns the signed decision function value. Does the negative sign denotes a Positive label '1'? I made few experiments* to reach this conclusion and I just want a confirmation from anyone knowledgeable/experienced with SVMs.
*The experiments was applied on 2 positives and 2 negatives using float response = predict(inputMat, true);
once and then using float response = predict(inputMat); //Default false, returns label
. I hope my conclusion applies to any image. Thank you :)
I think you should -1 and 1 as labels if I am correct for your classes... the same output should be generated then for both classes.
@StevenPuttemans Hi there, do you mean -1 for positive and 1 for negative or it doesn't matter? thanks
In practice people take +1 for positives; but it does not really matter in fact.
thanks @StevenPuttemans. your help is most appreciated. just pardon me for my last question, does the negative response in my experiment is due to training the positive set first then the negative set?
You train an SVM all at once afaik, pos and negatives together with their label.
thank you so much, @StevenPuttemans.
You are welcome