MATLAB File Help: cv.SVM/trainAuto Index
cv.SVM/trainAuto

Trains an SVM with optimal parameters

status = model.trainAuto(samples, responses)
status = model.trainAuto(csvFilename, [])
[...] = model.trainAuto(..., 'OptionName', optionValue, ...)

Input

Output

Options

The method trains the SVM model automatically by choosing the optimal parameters C, Gamma, P, Nu, Coef0, Degree of an SVM model. Parameters are considered optimal when the cross-validation estimate of the test set error is minimal.

If there is no need to optimize a parameter, the corresponding grid step should be set to any value less than or equal to 1. For example, to avoid optimization in gamma, set logStep = 0 in GammaGrid, and minVal, maxVal as arbitrary numbers. In this case, the value of the parameter Gamma is taken for gamma.

And, finally, if the optimization in a parameter is required but the corresponding grid is unknown, you may set it by name to obtain the default grid of that parameter. To generate a grid, for example, for gamma, set GammaGrid='Gamma'.

This function works for the classification (C_SVC or NU_SVC) as well as for the regression (EPS_SVR or NU_SVR). For ONE_CLASS, no optimization is made and the usual SVM with the specified parameters is executed.

See also
Method Details
Access public
Sealed false
Static false