Evaluation
classin packageklyn.math.nn
public class Evaluation
Evaluation

Sample-weighted supervised metrics, independent of batch partitioning. Classification accuracy is a fraction in [0, 1], not a percentage. Regression reports loss only and never fabricates an accuracy value.

Example

print(model.evaluate(xTest, yTest).accuracy)

Properties
Modifier and Type Member Description
public readonly property accuracy
accuracy as Double
Fraction of correctly classified samples.
public readonly property hasAccuracy
hasAccuracy as Boolean
Whether accuracy was evaluated for classification.
public readonly property loss
loss as Double
Mean per-sample loss.
public readonly property samples
samples as ULong
Number of samples contributing to the metrics.
Constructors
Modifier and Type Member Description
public Evaluation
Evaluation(totalLoss as Double, correct as ULong, samples as ULong)
Constructs metrics from accumulated loss and correct predictions.
public Evaluation
Evaluation(totalLoss as Double, samples as ULong)
Constructs loss-only regression metrics.
Methods
Modifier and Type Member Description
public static fromMean
fromMean(meanLoss as Double, samples as ULong, correct as ULong = 0ul, hasAccuracy as Boolean = false) as Evaluation
Builds metrics from an already reduced mean without multiplying it by the sample count, which could overflow even when the mean is finite.