I keep getting this error when i try to train a random forest model.
Warning message:
All models failed in tune_grid(). See the .notes
column.
## SPLITS
train_split <- initial_split(train_processed, prop = 0.8)
data_train <- training(train_split)
data_test <- testing(train_split)
## RANDOM FOREST RECIPE
ranger_recipe <-
recipe(label ~ .,
data = data_train) %>%
step_date(join_date, features = c("month", "year")) %>%
step_zv(all_predictors())
## MODEL SPEC
ranger_spec <-
rand_forest(mtry = tune(),
min_n = tune(),
trees = 1000) %>%
set_mode("classification") %>%
set_engine("ranger")
## WORKFLOW
ranger_workflow <-
workflow() %>%
add_recipe(ranger_recipe) %>%
add_model(ranger_spec)
## CV
set.seed(1234)
d_folds <- vfold_cv(data_train, v = 10, strata = label)
d_folds
## PARALLEL PROCESSING
doParallel::registerDoParallel()
##TUNING
set.seed(25508)
tune_res <- tune_grid(
ranger_workflow,
resamples = d_folds,
grid = 20
)