Wrong result in RBF SVM in contrast with orignal libSVM (Bug #4131)


Added by Yida Wang about 10 years ago. Updated about 10 years ago.


Status:Done Start date:2015-01-18
Priority:High Due date:
Assignee:Yida Wang % Done:

100%

Category:-
Target version:2.4.11
Affected version:2.4.9 (latest release) Operating System:Windows
Difficulty:Medium HW Platform:x64
Pull request:

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

Also available in: Atom PDF