Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

is the sigmoid kernel in SVM same as it in LIBSVM?

        Ptr<SVM> svm = SVM::create();
        svm->setType(SVM::C_SVC);
        svm->setKernel(3);
        svm->setDegree(3); // have to set the param, runtime error
        svm->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, 0.01));
        svm->trainAuto(_Samples, 10, SVM::getDefaultGrid(SVM::C), SVM::getDefaultGrid(SVM::GAMMA),
        SVM::getDefaultGrid(SVM::P), SVM::getDefaultGrid(SVM::NU), SVM::getDefaultGrid(SVM::COEF),
        SVM::getDefaultGrid(SVM::DEGREE), true);
        svm->predict(Test, results);

using LIBSVM with sigmoid can achieve 86% of accuracy, but using cv can only get about 40%. what's wrong with my code?

click to hide/show revision 2
retagged

is the sigmoid kernel in SVM same as it in LIBSVM?

        Ptr<SVM> svm = SVM::create();
        svm->setType(SVM::C_SVC);
        svm->setKernel(3);
        svm->setDegree(3); // have to set the param, runtime error
        svm->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, 0.01));
        svm->trainAuto(_Samples, 10, SVM::getDefaultGrid(SVM::C), SVM::getDefaultGrid(SVM::GAMMA),
        SVM::getDefaultGrid(SVM::P), SVM::getDefaultGrid(SVM::NU), SVM::getDefaultGrid(SVM::COEF),
        SVM::getDefaultGrid(SVM::DEGREE), true);
        svm->predict(Test, results);

using LIBSVM with sigmoid can achieve 86% of accuracy, but using cv can only get about 40%. what's wrong with my code?