This function is intended for internal use. It implements post-processing
inside of the predict() method for a fitted workflow.
Usage
apply_frosting(workflow, ...)
# Default S3 method
apply_frosting(workflow, components, ...)
# S3 method for class 'epi_workflow'
apply_frosting(workflow, components, new_data, type = NULL, opts = list(), ...)Arguments
- workflow
An object of class workflow
- ...
additional arguments passed on to methods
- components
a list of components containing model information. These will be updated and returned by the layer. These should be
mold- the output of callinghardhat::mold()on the workflow. This contains information about the preprocessing, including the recipe.forged- the output of callinghardhat::forge()on the workflow. This should have predictors and outcomes for thenew_data. It will have three componentspredictors,outcomes(if these were in thenew_data), andextras(usually has the rest of the data, includingkeys).keys- we put the keys (time_value,geo_value, and any others) here for ease.
- new_data
a data frame containing the new predictors to preprocess and predict on
- type, opts
forwarded (along with
...) topredict.model_fit()andslather()for supported layers