ertk.classification.standard_class_scoring

ertk.classification.standard_class_scoring(classes: Sequence[str])

Given a list of classes, returns scikit-learn scorers for overall metrics and per-class metrics, for multiclass classification.

The metrics are:
Overall:

uar: Balanced accuracy war: Accuracy microf1: Micro averaged F1 score macrof1: Macro averaged F1 score

Per-class:

{class}_rec: Recall {class}_prec: Precision {class}_f1: F1 score {class}_ba: Binary accuracy

Binary accuracy is calculated as the accuracy when considering labels for a class in a one-vs-rest scenario (i.e. the sum of cell (i, i) in the confusion matrix and all other cells not in row or column i).