svm predict not correct [closed]

asked 2015-11-20 18:50:18 -0600

nqthiep gravatar image

Hi all,

I trying to implement a class, the purpose is tranning and detect a number. Source as following:

            model = SVM::create();
            model->setType(SVM::C_SVC);
            model->setKernel(SVM::LINEAR);
            model->setC(7);
            model->setNu(SVM::NU_SVC);
            model->setP(0);
            model->setDegree(0);
            model->setGamma(20);
            model->setCoef0(0);
            TermCriteria term(CV_TERMCRIT_ITER +CV_TERMCRIT_EPS, 1000, 1e-6);
            model->setTermCriteria(term);
            model->train(dataTraining->getTrainData());

But predict function always return a large result. I dont know why it work not good.

I attached full source code, please help us solve this issue.

http://www.mediafire.com/download/l6i...

Thanks & Best Regards,

Thiep

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by nqthiep
close date 2015-11-26 19:37:36.347888

Comments

Hmmm just a thought, noone will download code files in zip format from another source, open it up, debug the project and get back to you. You at least need to concisely bring together all the necessary pieces of your problems!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-23 08:44:34 -0600 )edit

Thank you for advice. I will rewrite my question for easy understanding.

nqthiep gravatar imagenqthiep ( 2015-11-25 09:59:09 -0600 )edit