cmu-delphi / epipredict

Tools for building predictive models in epidemiology.
https://cmu-delphi.github.io/epipredict/
Other
8 stars 9 forks source link

Change `predictors` to default to `outcome` for `arx_forecaster` #298

Closed dshemetov closed 6 months ago

dshemetov commented 6 months ago

It's in the name that arx_forecaster is autoregressive, so there's an implicit assumption of the predictor being equal to the outcome. So we should update the function signature to

arx_forecaster(
  epi_data,
  outcome,
  predictors = outcome,
  trainer = parsnip::[linear_reg](https://parsnip.tidymodels.org/reference/linear_reg.html)(),
  args_list = [arx_args_list](https://cmu-delphi.github.io/epipredict/reference/arx_args_list.html)()
)

and add this text to the predictors arg documentation line

#' @param predictors A character vector giving column(s) of predictor
#'   variables. By default, equals the outcome. If manually specified, does not 
#'   add the outcome variable, so make sure to specify it.