C# Класс OpenCvSharp.ML.StatModel

Base class for statistical models in ML
Наследование: Algorithm
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
StatModel ( ) : System

Default constructor

Описание методов

CalcError() публичный Метод

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.
Результат float

Empty() публичный Метод

public Empty ( ) : bool
Результат bool

GetVarCount() публичный Метод

Returns the number of variables in training samples
public GetVarCount ( ) : int
Результат int

IsClassifier() публичный Метод

Returns true if the model is classifier
public IsClassifier ( ) : bool
Результат bool

IsTrained() публичный Метод

Returns true if the model is trained
public IsTrained ( ) : bool
Результат bool

Predict() публичный Метод

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.
Результат float

StatModel() защищенный Метод

Default constructor
protected StatModel ( ) : System
Результат System

Train() публичный Метод

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.
Результат bool

Train() публичный Метод

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).
Результат bool