Skip to main content

Module classification

Module classification 

Source
Expand description

Classification metrics — accuracy, the binary confusion matrix and its derived rates, ROC AUC (rank form, reusing the statistics ranker), and log-loss.

Structs§

ConfusionBinary
Binary confusion matrix (positive class = true).

Functions§

accuracy
Fraction of exact matches between predicted and true class labels. None if lengths differ or are empty.
confusion_binary
Build the binary confusion matrix from predicted/true boolean labels.
log_loss
Binary cross-entropy (log-loss): −(1/n)Σ[yᵢln pᵢ + (1−yᵢ)ln(1−pᵢ)], with p clamped away from 0/1 for numerical safety. None on a length mismatch.
roc_auc
ROC AUC via the Mann–Whitney rank statistic: AUC = (R₊ − n₊(n₊+1)/2) / (n₊·n₋), where R₊ is the sum of the (tie-averaged) ranks of the positive-class scores. Reuses the statistics ranker. None if the inputs mismatch or a class is empty.