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§
- Confusion
Binary - Binary confusion matrix (positive class =
true).
Functions§
- accuracy
- Fraction of exact matches between predicted and true class labels.
Noneif 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ᵢ)], withpclamped away from 0/1 for numerical safety.Noneon a length mismatch. - roc_auc
- ROC AUC via the Mann–Whitney rank statistic:
AUC = (R₊ − n₊(n₊+1)/2) / (n₊·n₋), whereR₊is the sum of the (tie-averaged) ranks of the positive-class scores. Reuses the statistics ranker.Noneif the inputs mismatch or a class is empty.