fit-epi_workflow: Fit an 'epi_workflow' object

fit-epi_workflowR Documentation

Fit an epi_workflow object

Description

This is the fit() method for an epi_workflow object that estimates parameters for a given model from a set of data. Fitting an epi_workflow involves two main steps, which are preprocessing the data and fitting the underlying parsnip model.

Usage

## S3 method for class 'epi_workflow'
fit(object, data, ..., control = workflows::control_workflow())

Arguments

object

an epi_workflow object

data

an epi_df of predictors and outcomes to use when fitting the epi_workflow

...

Not used

control

A workflows::control_workflow() object

Value

The epi_workflow object, updated with a fit parsnip model in the object$fit$fit slot.

See Also

workflows::fit-workflow

Examples

jhu <- covid_case_death_rates %>%
  filter(time_value > "2021-11-01", geo_value %in% c("ak", "ca", "ny"))

r <- epi_recipe(jhu) %>%
  step_epi_lag(death_rate, lag = c(0, 7, 14)) %>%
  step_epi_ahead(death_rate, ahead = 7)

wf <- epi_workflow(r, parsnip::linear_reg()) %>% fit(jhu)
wf


cmu-delphi/epipredict documentation built on March 5, 2025, 12:17 p.m.