$svm = new SVM();
$cross = $svm->crossvalidate("/svmScaled.data" , 5); // 5 fold cross val
var_dump($cross); //(PECL svm >= 0.1.0)
SVM::crossvalidate — Test training params on subsets of the training data
Crossvalidate can be used to test the effectiveness of the current parameter set on a subset of the training data. Given a problem set and a n "folds", it separates the problem set into n subsets, and the repeatedly trains on one subset and tests on another. While the accuracy will generally be lower than a SVM trained on the enter data set, the accuracy score returned should be relatively useful, so it can be used to test different training parameters.
problemnumber_of_foldsThe correct percentage, expressed as a floating point number from 0-1. In the case of NU_SVC or EPSILON_SVR kernels the mean squared error will returned instead.
$svm = new SVM();
$cross = $svm->crossvalidate("/svmScaled.data" , 5); // 5 fold cross val
var_dump($cross); //