C# Class OpenCvSharp.ML.StatModel

Base class for statistical models in ML
Inheritance: Algorithm
Afficher le fichier Open project: shimat/opencvsharp

Méthodes publiques

Méthode Description
CalcError ( OpenCvSharp.ML.TrainData data, bool test, OutputArray resp ) : float

Computes error on the training or test dataset

Empty ( ) : bool

GetVarCount ( ) : int

Returns the number of variables in training samples

IsClassifier ( ) : bool

Returns true if the model is classifier

IsTrained ( ) : bool

Returns true if the model is trained

Predict ( InputArray samples, OutputArray results = null, Flags flags ) : float

Predicts response(s) for the provided sample(s)

Train ( InputArray samples, SampleTypes layout, InputArray responses ) : bool

Trains the statistical model

Train ( TrainData trainData, int flags ) : bool

Trains the statistical model

Méthodes protégées

Méthode Description
StatModel ( ) : System

Default constructor

Method Details

CalcError() public méthode

Computes error on the training or test dataset
public CalcError ( OpenCvSharp.ML.TrainData data, bool test, OutputArray resp ) : float
data OpenCvSharp.ML.TrainData the training data
test bool if true, the error is computed over the test subset of the data, /// otherwise it's computed over the training subset of the data. Please note that if you /// loaded a completely different dataset to evaluate already trained classifier, you will /// probably want not to set the test subset at all with TrainData::setTrainTestSplitRatio /// and specify test=false, so that the error is computed for the whole new set. Yes, this /// sounds a bit confusing.
resp OutputArray the optional output responses.
Résultat float

Empty() public méthode

public Empty ( ) : bool
Résultat bool

GetVarCount() public méthode

Returns the number of variables in training samples
public GetVarCount ( ) : int
Résultat int

IsClassifier() public méthode

Returns true if the model is classifier
public IsClassifier ( ) : bool
Résultat bool

IsTrained() public méthode

Returns true if the model is trained
public IsTrained ( ) : bool
Résultat bool

Predict() public méthode

Predicts response(s) for the provided sample(s)
public Predict ( InputArray samples, OutputArray results = null, Flags flags ) : float
samples InputArray The input samples, floating-point matrix
results OutputArray The optional output matrix of results.
flags Flags The optional flags, model-dependent.
Résultat float

StatModel() protected méthode

Default constructor
protected StatModel ( ) : System
Résultat System

Train() public méthode

Trains the statistical model
public Train ( InputArray samples, SampleTypes layout, InputArray responses ) : bool
samples InputArray training samples
layout SampleTypes SampleTypes value
responses InputArray vector of responses associated with the training samples.
Résultat bool

Train() public méthode

Trains the statistical model
public Train ( TrainData trainData, int flags ) : bool
trainData TrainData training data that can be loaded from file using TrainData::loadFromCSV /// or created with TrainData::create.
flags int optional flags, depending on the model. Some of the models can be updated with the /// new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP).
Résultat bool