Do you need to bake testing data prior to predicting tidymodels/stacks?

I am using a tidymodels workflow with a custom recipe to tune multiple models. These models are then fed into tidymodels/stacks for blending and fitting. For example:

  # Create the base stacked model
  stacked_models <- 
    stacks() %>%
    add_candidates(tuned_model) 
  
  # Blend all of the model components
  blended_stack <-
    stacked_models %>%
    blend_predictions(
      control = tune::control_grid(allow_par = TRUE))
  
  # Produce the Final Stacked Model
  fit_stacked_model <-
    blended_stack %>%
    fit_members()

When predicting on the fit_stacked_model object, does the testing data need to be prep() and bake() prior to predicting, or does stacks account for that in the backend?

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.