Click or drag to resize

SVMTrainAuto Method

Trains an %SVM with optimal parameters.

Namespace:  OpenCvSharp.ML
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public bool TrainAuto(
	TrainData data,
	int kFold = 10,
	Nullable<ParamGrid> cGrid = null,
	Nullable<ParamGrid> gammaGrid = null,
	Nullable<ParamGrid> pGrid = null,
	Nullable<ParamGrid> nuGrid = null,
	Nullable<ParamGrid> coeffGrid = null,
	Nullable<ParamGrid> degreeGrid = null,
	bool balanced = false
)

Parameters

data
Type: OpenCvSharp.MLTrainData
the training data that can be constructed using TrainData::create or TrainData::loadFromCSV.
kFold (Optional)
Type: SystemInt32
Cross-validation parameter. The training set is divided into kFold subsets. One subset is used to test the model, the others form the train set. So, the %SVM algorithm is executed kFold times.
cGrid (Optional)
Type: SystemNullableParamGrid
grid for C
gammaGrid (Optional)
Type: SystemNullableParamGrid
grid for gamma
pGrid (Optional)
Type: SystemNullableParamGrid
grid for p
nuGrid (Optional)
Type: SystemNullableParamGrid
grid for nu
coeffGrid (Optional)
Type: SystemNullableParamGrid
grid for coeff
degreeGrid (Optional)
Type: SystemNullableParamGrid
grid for degree
balanced (Optional)
Type: SystemBoolean
If true and the problem is 2-class classification then the method creates more balanced cross-validation subsets that is proportions between classes in subsets are close to such proportion in the whole train dataset.

Return Value

Type: Boolean

[Missing <returns> documentation for "M:OpenCvSharp.ML.SVM.TrainAuto(OpenCvSharp.ML.TrainData,System.Int32,System.Nullable{OpenCvSharp.ML.ParamGrid},System.Nullable{OpenCvSharp.ML.ParamGrid},System.Nullable{OpenCvSharp.ML.ParamGrid},System.Nullable{OpenCvSharp.ML.ParamGrid},System.Nullable{OpenCvSharp.ML.ParamGrid},System.Nullable{OpenCvSharp.ML.ParamGrid},System.Boolean)"]

See Also