Метод | Описание | |
---|---|---|
Create ( ) : |
Creates empty model. Use StatModel::Train to train the model. Since %SVM has several parameters, you may want to find the best parameters for your problem, it can be done with SVM::TrainAuto.
|
|
GetDecisionFunction ( int i, OutputArray alpha, OutputArray svidx ) : double |
Retrieves the decision function
|
|
GetDefaultGrid ( ParamTypes paramId ) : OpenCvSharp.ML.ParamGrid |
Generates a grid for SVM parameters.
|
|
GetSupportVectors ( ) : Mat |
Retrieves all the support vectors
|
|
SetCustomKernel ( Kernel kernel ) : void |
Initialize with custom kernel.
|
|
TrainAuto ( OpenCvSharp.ML.TrainData data, int kFold = 10, OpenCvSharp.ML.ParamGrid cGrid = null, OpenCvSharp.ML.ParamGrid gammaGrid = null, OpenCvSharp.ML.ParamGrid pGrid = null, OpenCvSharp.ML.ParamGrid nuGrid = null, OpenCvSharp.ML.ParamGrid coeffGrid = null, OpenCvSharp.ML.ParamGrid degreeGrid = null, bool balanced = false ) : bool |
Trains an %SVM with optimal parameters.
|
Метод | Описание | |
---|---|---|
Dispose ( bool disposing ) : void |
Clean up any resources being used.
|
|
SVM ( |
Creates instance by raw pointer cv::ml::SVM*
|
protected Dispose ( bool disposing ) : void | ||
disposing | bool | /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. /// |
Результат | void |
public GetDecisionFunction ( int i, OutputArray alpha, OutputArray svidx ) : double | ||
i | int | i the index of the decision function. /// If the problem solved is regression, 1-class or 2-class classification, then /// there will be just one decision function and the index should always be 0. /// Otherwise, in the case of N-class classification, there will be N(N-1)/2 decision functions. |
alpha | OutputArray | alpha the optional output vector for weights, corresponding to /// different support vectors. In the case of linear %SVM all the alpha's will be 1's. |
svidx | OutputArray | the optional output vector of indices of support vectors /// within the matrix of support vectors (which can be retrieved by SVM::getSupportVectors). /// In the case of linear %SVM each decision function consists of a single "compressed" support vector. |
Результат | double |
public static GetDefaultGrid ( ParamTypes paramId ) : OpenCvSharp.ML.ParamGrid | ||
paramId | ParamTypes | SVM parameters IDs that must be one of the SVM::ParamTypes. /// The grid is generated for the parameter with this ID. |
Результат | OpenCvSharp.ML.ParamGrid |
public SetCustomKernel ( Kernel kernel ) : void | ||
kernel | Kernel | |
Результат | void |
public TrainAuto ( OpenCvSharp.ML.TrainData data, int kFold = 10, OpenCvSharp.ML.ParamGrid cGrid = null, OpenCvSharp.ML.ParamGrid gammaGrid = null, OpenCvSharp.ML.ParamGrid pGrid = null, OpenCvSharp.ML.ParamGrid nuGrid = null, OpenCvSharp.ML.ParamGrid coeffGrid = null, OpenCvSharp.ML.ParamGrid degreeGrid = null, bool balanced = false ) : bool | ||
data | OpenCvSharp.ML.TrainData | the training data that can be constructed using /// TrainData::create or TrainData::loadFromCSV. |
kFold | int | 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 | OpenCvSharp.ML.ParamGrid | grid for C |
gammaGrid | OpenCvSharp.ML.ParamGrid | grid for gamma |
pGrid | OpenCvSharp.ML.ParamGrid | grid for p |
nuGrid | OpenCvSharp.ML.ParamGrid | grid for nu |
coeffGrid | OpenCvSharp.ML.ParamGrid | grid for coeff |
degreeGrid | OpenCvSharp.ML.ParamGrid | grid for degree |
balanced | bool | 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. |
Результат | bool |