klyn.math.nn.Evaluation.fromMean
method
public static fromMean(meanLoss as Double, samples as ULong, correct as ULong = 0ul, hasAccuracy as Boolean = false) as Evaluation
Description

Builds metrics from an already reduced mean without multiplying it by the sample count, which could overflow even when the mean is finite.

Parameters
ParameterDescription
meanLossFinite non-negative mean objective.
samplesPositive observation count.
correctCorrect predictions, used only when hasAccuracy is true.
hasAccuracyFalse for regression; true for classification.
Returns

Independent evaluation.

Throws
  • ValueException for invalid means or counts.
Example

result = Evaluation.fromMean(0.25, 100ul)