CvSVMTrainAuto Method (Mat, Mat, Mat, Mat, CvSVMParams, Int32, NullableCvParamGrid, NullableCvParamGrid, NullableCvParamGrid, NullableCvParamGrid, NullableCvParamGrid, NullableCvParamGrid, Boolean) OpenCvSharp Class Library
Trains SVM with optimal parameters

Namespace:  OpenCvSharp.CPlusPlus
Assembly:  OpenCvSharp.CPlusPlus (in OpenCvSharp.CPlusPlus.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public virtual bool TrainAuto(
	Mat trainData,
	Mat responses,
	Mat varIdx,
	Mat sampleIdx,
	CvSVMParams param,
	int kFold = 10,
	Nullable<CvParamGrid> cGrid = null,
	Nullable<CvParamGrid> gammaGrid = null,
	Nullable<CvParamGrid> pGrid = null,
	Nullable<CvParamGrid> nuGrid = null,
	Nullable<CvParamGrid> coefGrid = null,
	Nullable<CvParamGrid> degreeGrid = null,
	bool balanced = false
)

Parameters

trainData
Type: OpenCvSharp.CPlusPlusMat

[Missing <param name="trainData"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

responses
Type: OpenCvSharp.CPlusPlusMat

[Missing <param name="responses"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

varIdx
Type: OpenCvSharp.CPlusPlusMat

[Missing <param name="varIdx"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

sampleIdx
Type: OpenCvSharp.CPlusPlusMat

[Missing <param name="sampleIdx"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

param
Type: OpenCvSharp.CPlusPlusCvSVMParams

[Missing <param name="param"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

kFold (Optional)
Type: SystemInt32
Cross-validation parameter. The training set is divided into k_fold subsets, one subset being used to train the model, the others forming the test set. So, the SVM algorithm is executed k_fold times.
cGrid (Optional)
Type: SystemNullableCvParamGrid

[Missing <param name="cGrid"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

gammaGrid (Optional)
Type: SystemNullableCvParamGrid

[Missing <param name="gammaGrid"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

pGrid (Optional)
Type: SystemNullableCvParamGrid

[Missing <param name="pGrid"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

nuGrid (Optional)
Type: SystemNullableCvParamGrid

[Missing <param name="nuGrid"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

coefGrid (Optional)
Type: SystemNullableCvParamGrid

[Missing <param name="coefGrid"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

degreeGrid (Optional)
Type: SystemNullableCvParamGrid

[Missing <param name="degreeGrid"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

balanced (Optional)
Type: SystemBoolean

[Missing <param name="balanced"/> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:OpenCvSharp.CPlusPlus.CvSVM.TrainAuto(OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.Mat,OpenCvSharp.CPlusPlus.CvSVMParams,System.Int32,System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Nullable{OpenCvSharp.CPlusPlus.CvParamGrid},System.Boolean)"]

See Also

Reference