| 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
)
Public Function TrainAuto (
data As TrainData,
Optional kFold As Integer = 10,
Optional cGrid As Nullable(Of ParamGrid) = Nothing,
Optional gammaGrid As Nullable(Of ParamGrid) = Nothing,
Optional pGrid As Nullable(Of ParamGrid) = Nothing,
Optional nuGrid As Nullable(Of ParamGrid) = Nothing,
Optional coeffGrid As Nullable(Of ParamGrid) = Nothing,
Optional degreeGrid As Nullable(Of ParamGrid) = Nothing,
Optional balanced As Boolean = false
) As Boolean
public:
bool TrainAuto(
TrainData^ data,
int kFold = 10,
Nullable<ParamGrid> cGrid = nullptr,
Nullable<ParamGrid> gammaGrid = nullptr,
Nullable<ParamGrid> pGrid = nullptr,
Nullable<ParamGrid> nuGrid = nullptr,
Nullable<ParamGrid> coeffGrid = nullptr,
Nullable<ParamGrid> degreeGrid = nullptr,
bool balanced = false
)
member TrainAuto :
data : TrainData *
?kFold : int *
?cGrid : Nullable<ParamGrid> *
?gammaGrid : Nullable<ParamGrid> *
?pGrid : Nullable<ParamGrid> *
?nuGrid : Nullable<ParamGrid> *
?coeffGrid : Nullable<ParamGrid> *
?degreeGrid : Nullable<ParamGrid> *
?balanced : bool
(* Defaults:
let _kFold = defaultArg kFold 10
let _cGrid = defaultArg cGrid null
let _gammaGrid = defaultArg gammaGrid null
let _pGrid = defaultArg pGrid null
let _nuGrid = defaultArg nuGrid null
let _coeffGrid = defaultArg coeffGrid null
let _degreeGrid = defaultArg degreeGrid null
let _balanced = defaultArg balanced false
*)
-> bool
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