Table of Contents

Method CalcError

Namespace
OpenCvSharp.ML
Assembly
OpenCvSharp.dll

CalcError(TrainData, bool, OutputArray)

Computes error on the training or test dataset

public virtual float CalcError(TrainData data, bool test, OutputArray resp)

Parameters

data 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.

Returns

float