library(dplyr)
data("two_class_example")
data("hpc_cv")
# Two class
mcc(two_class_example, truth, predicted)
# Multiclass
# mcc() has a natural multiclass extension
hpc_cv %>%
filter(Resample == "Fold01") %>%
mcc(obs, pred)
# Groups are respected
hpc_cv %>%
group_by(Resample) %>%
mcc(obs, pred)
Run the code above in your browser using DataLab