1 | initial version |
default kfolds value for trainAuto is 10, if you want 5 folds, you have to specify:
svm->trainAuto(td, 5);
if you leave all param grids at default, it might take very long, since each combination is tested against each other. if you're specifically interested in gamma and C (you do not need nu, coef0 or p for the RBF kernel), make a "nogrid" param for the others:
Ptr<ml::SVM::ParamGrid> nogrid = ml::SVM::ParamGrid::create(0,0,0);
svm->trainAuto(td, 5, getDefaultGrid(C), getDefaultGrid(GAMMA), nogrid, nogrid, nogrid, nogrid);