tidymodels, how to set verbosity when fitting a workflow

tidymodels, how to set verbosity when fitting a workflow

myModel<- workflow() %>%
add_model(model_spec) %>%
add_recipe(recipe_spec) %>%
fit(df_train,verbosity=0) <-does not work

does not work too:

Sorry that this is confusing.

verbosity is not an argument to fit.workflow() so that shouldn't work. Here is the help page.

To set the verbosity of the model, you can quiet the results using control_parsnip() (as you show). Since this isn't a reproducible example, we can't tell what went wrong for your data/models, but here is an example where it does work:


chatty <- 
  mlp() %>% 
  set_engine("nnet", trace = TRUE) %>% 

nn_wflow <- 
  workflow() %>%
  add_formula(price ~ type + sqft + beds + baths) %>% 

nn_fit <- fit(nn_wflow, Sacramento)
#> # weights:  36
#> initial  value 72712505768277.218750 
#> final  value 16007850421474.472656 
#> converged

model_ctrl <- control_parsnip(verbosity = 0L)
nn_fit_check <- fit(nn_wflow, Sacramento, control = control_workflow(model_ctrl))

Created on 2022-01-31 by the reprex package (v2.0.1)

1 Like

Thx... works fine, I guess.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.