C# 클래스 OpenCvSharp.ML.SVM

Support Vector Machines
상속: StatModel
파일 보기 프로젝트 열기: shimat/opencvsharp

공개 메소드들

메소드 설명
Create ( ) : SVM

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 ( IntPtr p ) : System

Creates instance by raw pointer cv::ml::SVM*

메소드 상세

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.
public static Create ( ) : SVM
리턴 SVM

Dispose() 보호된 메소드

Clean up any resources being used.
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

GetDecisionFunction() 공개 메소드

Retrieves the decision function
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

GetDefaultGrid() 공개 정적인 메소드

Generates a grid for SVM parameters.
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

GetSupportVectors() 공개 메소드

Retrieves all the support vectors
public GetSupportVectors ( ) : Mat
리턴 Mat

SVM() 보호된 메소드

Creates instance by raw pointer cv::ml::SVM*
protected SVM ( IntPtr p ) : System
p System.IntPtr
리턴 System

SetCustomKernel() 공개 메소드

Initialize with custom kernel.
public SetCustomKernel ( Kernel kernel ) : void
kernel Kernel
리턴 void

TrainAuto() 공개 메소드

Trains an %SVM with optimal parameters.
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