Click or drag to resize

StatModelCalcError Method

Computes error on the training or test dataset

Namespace:  OpenCvSharp.ML
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 3.4.1.20180605-33-CaRLSharp
Syntax
public virtual float CalcError(
	TrainData data,
	bool test,
	OutputArray resp
)

Parameters

data
Type: OpenCvSharp.MLTrainData
the training data
test
Type: SystemBoolean
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
Type: OpenCvSharpOutputArray
the optional output responses.

Return Value

Type: Single
See Also