Tidymodels "recipe 1/4: Error: could not find function \"all_numeric\""


I am currently trying to tune a model using the new tidymodels package
This is basically a learning exercise for me
All my models fail with the error message:

1 "recipe 1/4: Error: could not find function \"all_numeric\""
2 "recipe 2/4: Error: could not find function \"all_numeric\""
3 "recipe 3/4: Error: could not find function \"all_numeric\""
4 "recipe 4/4: Error: could not find function \"all_numeric\""

This isn't something I could find when i googled around.
I am able to get this to run on an old laptop but not when i move it to my work PC
I have re-installed both the tidyverse and tidymodels.
Does anyone have any suggestions?

Thank you for your time


mydf <- iris %>% 
  mutate(tgt_setosa = ifelse(.$Species == 'setosa', 'Y', 'N')) %>% 

# Higlight what we have created for the top ten rows
glimpse(mydf, 10)

# CREATE A MODELLING WORKFLOW ---------------------------------------------
flower_rec <- recipe(tgt_setosa ~ ., data = mydf) %>%
  step_nzv(all_numeric(), -all_outcomes()) %>%
  step_normalize(all_numeric(), -all_outcomes()) %>%
  step_center(all_numeric(), -all_outcomes()) %>% 
  step_upsample(tgt_setosa, over_ratio = tune()) %>% 
  step_corr(all_numeric(), -all_outcomes(), threshold = tune())

# Create the specification
tree_spec <- decision_tree(cost_complexity = tune(), tree_depth = tune()) %>%
  set_engine("rpart") %>%

# Set up the cross validation for this
cv_splits <- vfold_cv(mydf, strata = "tgt_setosa", repeats = 1)

# Set up the grid
mygrid <- grid_regular(
  levels = 2

# Fit the models
tree_results <- tune_grid(
  object = flower_rec,
  model = tree_spec,
  resamples = cv_splits,
  grid = mygrid,
  metrics = metric_set(roc_auc, sens, spec)


It runs without that error but tree_results$.notes entries are all empty. For the error message try


You probably need to update recipes. Giving us session info would help.

1 Like

Hi @Max

Updating recipes did the trick


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.