Wrong result in RBF SVM in contrast with orignal libSVM (Bug #4131)
Description
As described in preference documentation:http://docs.opencv.org/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.html
If I replce:params.kernel_type = CvSVM::LINEAR;
with
params.kernel_type = CvSVM::RBF;
params.gamma = 1;
and change the data point to another 4 points(could be easily set apart with eac others) which are
float trainingData4[2] = { { 501, 10 }, { 10, 230 }, { 30, 240 }, { 20, 230 } };
I could just get a one class classification result from the svm.predict as shown in the RBFSVM_OpenCV.bmp and 4 support vectors
History
Updated by Yida Wang about 10 years ago
It's done, the problem lies on the parameter svmparameter.gamma, it should be set as smaller as data point differs much.
In such condition, I set it as 0.0001, and the problem get solved.
- % Done changed from 0 to 100
- Status changed from New to Done
- Assignee set to Yida Wang