Trying to use different step_select functions from the colino package before fitting multiple models with workflow_set(). Apparently using a step_select function as preprocessing in the recipe make it impossible to use worflow_map() after. The exact same error occurs wwhen uding tune_grid(), with a workflow including a step_select_*() function.
I also inspected the error report, and I was not able to identify what tibble is concerned by the error.
Error in purrr::map()
:
ℹ In index: 2.
Caused by error in tibble()
:
! Tibble columns must have compatible sizes.
• Size 2: Existing data.
• Size 3: Column call_info
.
ℹ Only values of size one are recycled.
library(parsnip)
library(dplyr)
library(fastDummies)
library(colino)
library(workflowsets)
library(tune)
data(iris)
logit_model <- logistic_reg(engine = "glm")
iris2 <- iris %>%
as_tibble() %>%
filter(Species != "setosa")
iris_cv <- vfold_cv(iris2)
recipe <- recipe(Species ~ ., data = iris2) %>%
step_nzv(all_predictors()) %>%
step_select_vip(all_predictors(), model = logit_model,
threshold = 0.9, outcome = "Species") %>%
step_normalize(all_numeric_predictors())
logit_vip2 <-
workflow_set(
preproc = list(rec = recipe),
models = list(logit = logistic_reg(engine = "glm")),
cross = TRUE)
res_logit_vip2 <-
logit_vip2 %>%
workflow_map(fn = "tune_grid", resamples =iris_cv,
verbose = TRUE, control =control_grid(verbose =TRUE))