## Multi-class: one row per class, then micro, macro and weighted averages
data(C3N150)
mdat <- mmdata(C3N150$scores, C3N150$labels)
classification_report(mdat, at = 0.5)
## A threshold per class, named or in class order
classification_report(mdat, at = c(c1 = 0.4, c2 = 0.5, c3 = 0.6))
## Binary: both classes, and an accuracy row rather than a micro average
data(P10N10)
classification_report(
scores = P10N10$scores, labels = P10N10$labels,
at = 12
)
## It is a data frame, so the usual accessors work
report <- classification_report(mdat, at = 0.5)
report[report$class == "macro avg", ]
Run the code above in your browser using DataLab