Skip to contents

This function is intended for internal use. It implements postprocessing 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 calling hardhat::mold() on the workflow. This contains information about the preprocessing, including the recipe.

  • forged - the output of calling hardhat::forge() on the workflow. This should have predictors and outcomes for the new_data. It will have three components predictors, outcomes (if these were in the new_data), and extras (usually has the rest of the data, including keys).

  • 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 ...) to predict.model_fit() and slather() for supported layers