Computes overall accuracy, macro-averaged F1, multiclass Matthews correlation coefficient (Gorodkin's \(R_K\)), per-class precision/recall/F1, the confusion matrix, and coverage (the fraction of cells with an accepted prediction), given predicted and ground-truth labels.
Arguments
- predicted
Character vector of predicted labels (
NA= abstain).- truth
Character vector of ground-truth labels, same length.
- accepted
Optional logical vector, same length. When supplied, only
accepted(and non-NA) predictions are scored; the rest are abstentions. WhenNULL(default), all non-NApredictions are scored.
Value
A list of class somalign_label_metrics with accuracy,
macro_f1, mcc, per_class (data frame), confusion (table), n
(scored predictions), coverage, and accuracy_all.