View source: R/conf_mat_resampled.R
conf_mat_resampled | R Documentation |
For classification problems, conf_mat_resampled()
computes a separate
confusion matrix for each resample then averages the cell counts.
conf_mat_resampled(x, ..., parameters = NULL, tidy = TRUE)
x |
An object with class |
... |
Currently unused, must be empty. |
parameters |
A tibble with a single tuning parameter combination. Only one tuning parameter combination (if any were used) is allowed here. |
tidy |
Should the results come back in a tibble ( |
A tibble or conf_mat
with the average cell count across resamples.
library(parsnip)
library(rsample)
library(dplyr)
data(two_class_dat, package = "modeldata")
set.seed(2393)
res <-
logistic_reg() %>%
set_engine("glm") %>%
fit_resamples(
Class ~ .,
resamples = vfold_cv(two_class_dat, v = 3),
control = control_resamples(save_pred = TRUE)
)
conf_mat_resampled(res)
conf_mat_resampled(res, tidy = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.