Skip to contents

Compute a weighted multiclass confusion matrix with PAC and PV summaries.

Usage

oda_confusion_multiclass(y, y_pred, w = NULL)

Arguments

y

Actual integer class labels.

y_pred

Predicted integer class labels.

w

Optional numeric weights. Default: unit weights.

Value

Named list:

confusion

C x C numeric matrix of weighted counts. With unit weights these are raw integer observation counts. Rows are actual classes; columns are predicted classes.

correct

Total weighted count of correct classifications.

overall_acc

Overall accuracy as a proportion [0, 1].

pac_by_class

Per-class sensitivity as proportions [0, 1].

mean_pac

Mean sensitivity across classes, proportion [0,1].

pv_by_class

Per-class predictive value, proportions [0, 1].

mean_pv

Mean predictive value, proportion [0, 1].