recipe: Error: could not find function "all_numeric"

Hi! This my first time using this forum so I'm hoping someone can help me. Using the code from this #TidyTuesday post (https://juliasilge.com/blog/last-airbender/), I'm getting the following error. I'm using recipes version 0.1.13. In March, there was a question very similar to this on this forum. The solution was to update recipes. I believe I'm using the most recent version of recipes.

set.seed(234)
avatar_folds <- vfold_cv(TCC9to17_2017, strata = retained)
avatar_folds

avatar_rec <- recipe(retained ~ ., data = TCC9to17_2017) %>%
  step_corr(all_numeric()) %>%
  step_YeoJohnson(all_numeric()) %>%
  step_dummy(all_predictors(), -all_numeric()) %>%
  step_zv(all_numeric()) %>%
  step_normalize(all_numeric()) %>%
  step_upsample(retained, skip = TRUE)

avatar_prep <- prep(avatar_rec)
avatar_prep

juice(avatar_prep)

rf_spec <- rand_forest(trees = 1000) %>%
  set_engine("ranger") %>%
  set_mode("classification")
rf_spec

avatar_wf <- workflow() %>%
  add_recipe(avatar_rec)
avatar_wf

doParallel::registerDoParallel()

set.seed(1234)
rf_rs <- avatar_wf %>%
  add_model(rf_spec) %>%
  fit_resamples(
    resamples = avatar_folds,
    metrics = metric_set(roc_auc, accuracy, sens, spec),
    control = control_grid(save_pred = TRUE)
  )

#############################
Warning message:
All models failed in [fit_resamples()]. See the `.notes` column. 
> rf_rs
# Resampling results
# 10-fold cross-validation using stratification 
# A tibble: 10 x 5
   splits             id     .metrics .notes           .predictions
   <list>             <chr>  <list>   <list>           <list>      
 1 <split [1.1K/128]> Fold01 <NULL>   <tibble [1 x 1]> <NULL>      
 2 <split [1.1K/128]> Fold02 <NULL>   <tibble [1 x 1]> <NULL>      
 3 <split [1.1K/128]> Fold03 <NULL>   <tibble [1 x 1]> <NULL>      
 4 <split [1.1K/128]> Fold04 <NULL>   <tibble [1 x 1]> <NULL>      
 5 <split [1.1K/128]> Fold05 <NULL>   <tibble [1 x 1]> <NULL>      
 6 <split [1.1K/128]> Fold06 <NULL>   <tibble [1 x 1]> <NULL>      
 7 <split [1.1K/128]> Fold07 <NULL>   <tibble [1 x 1]> <NULL>      
 8 <split [1.1K/128]> Fold08 <NULL>   <tibble [1 x 1]> <NULL>      
 9 <split [1.1K/127]> Fold09 <NULL>   <tibble [1 x 1]> <NULL>      
10 <split [1.2K/126]> Fold10 <NULL>   <tibble [1 x 1]> <NULL>      
Warning message:
This tuning result has notes. Example notes on model fitting include:
recipe: Error: could not find function "all_numeric"
recipe: Error: could not find function "all_numeric"
recipe: Error: could not find function "all_numeric"

Solved: It was the doParallel::registerDoParallel() causing the error.

There is a set of PRs for tune that resolve this issue.

Sounds good. Got a similar error (could not find "all_predictors") running code from Max's recent NYR Workshop (doParallel + Windows10).

Install the dev tune and recipes for the fix

Excellent---will try that today. Thanks for a great workshop Max.

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