arx_fcast_epi_workflow: Create a template 'arx_forecaster' workflow

View source: R/arx_forecaster.R

arx_fcast_epi_workflowR Documentation

Create a template arx_forecaster workflow

Description

This function creates an unfit workflow for use with arx_forecaster(). It is useful if you want to make small modifications to that forecaster before fitting and predicting. Supplying a trainer to the function may alter the returned epi_workflow object (e.g., if you intend to use quantile_reg()) but can be omitted.

Usage

arx_fcast_epi_workflow(
  epi_data,
  outcome,
  predictors = outcome,
  trainer = linear_reg(),
  args_list = arx_args_list()
)

Arguments

epi_data

An epi_df object

outcome

A character (scalar) specifying the outcome (in the epi_df).

predictors

A character vector giving column(s) of predictor variables. This defaults to the outcome. However, if manually specified, only those variables specifically mentioned will be used. (The outcome will not be added.) By default, equals the outcome. If manually specified, does not add the outcome variable, so make sure to specify it.

trainer

A {parsnip} model describing the type of estimation. For now, we enforce mode = "regression". May be NULL if you'd like to decide later.

args_list

A list of customization arguments to determine the type of forecasting model. See arx_args_list().

Value

An unfitted epi_workflow.

See Also

arx_forecaster()

Examples

jhu <- covid_case_death_rates %>%
  filter(time_value >= as.Date("2021-12-01"))

arx_fcast_epi_workflow(
  jhu, "death_rate",
  c("case_rate", "death_rate")
)

arx_fcast_epi_workflow(jhu, "death_rate",
  c("case_rate", "death_rate"),
  trainer = quantile_reg(),
  args_list = arx_args_list(quantile_levels = 1:9 / 10)
)

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