ConfusionMatrixResult
Snapshot of a weighted K-by-K confusion matrix indexed as counts[predicted][truth].
Exposes the family of confusion-matrix metrics as derived getters: per-class precision/recall/F1, macro and micro averages, accuracy, and Matthews correlation coefficient (defined for any K). Empty rows or columns yield 0 for the corresponding rate rather than NaN, which keeps macro averages well-defined while a stream is warming up.
Properties
Row-major numClasses * numClasses weights: counts[pred * numClasses + truth].
Macro precision: unweighted mean of per-class precision.
Macro recall: unweighted mean of per-class recall.
Number of classes.
Total weight across all cells.
ConfusionMatrixResult
accuracy
actualTotal
True-class total: weight of all columns where truth = c.
correct
count
counts
Row-major numClasses * numClasses weights: counts[pred * numClasses + truth].
equals
f1
hashCode
macroF1
macroPrecision
Macro precision: unweighted mean of per-class precision.
macroRecall
Macro recall: unweighted mean of per-class recall.
mcc
numClasses
Number of classes.
precision
predictedTotal
Predicted-class total: weight of all rows where prediction = c.
recall
totalWeights
Total weight across all cells.