data("two_class_example")
cmat <- conf_mat(two_class_example, truth = "truth", estimate = "predicted")
summary(cmat)
summary(cmat, prevalence = 0.70)
library(dplyr)
library(tidyr)
data("hpc_cv")
# Compute statistics per resample then summarize
all_metrics <- hpc_cv %>%
group_by(Resample) %>%
conf_mat(obs, pred) %>%
mutate(summary_tbl = lapply(conf_mat, summary)) %>%
unnest(summary_tbl)
all_metrics %>%
group_by(.metric) %>%
summarise(
mean = mean(.estimate, na.rm = TRUE),
sd = sd(.estimate, na.rm = TRUE)
)
Run the code above in your browser using DataLab