Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

svm predict not correct

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/l6iaiqv40yzk9ly/Number.zip

Thanks & Best Regards,

Thiep