library(tidymodels)
library(doParallel)
tidymodels_prefer()
theme_set(theme_bw())
options(pillar.advice = FALSE, pillar.min_title_chars = Inf)
cl <- makePSOCKcluster(parallel::detectCores(logical = FALSE))
registerDoParallel(cl)
data(cells, package = "modeldata")
cells$case <- NULL
set.seed(123)
cell_split <- initial_split(cells, prop = 0.8, strata = class)
cell_tr <- training(cell_split)
cell_te <- testing(cell_split)
set.seed(123)
cell_rs <- vfold_cv(cell_tr, v = 10, strata = class)
cls_metrics <- metric_set(brier_class, roc_auc, kap)