View source: R/arx_classifier.R
arx_classifier | R Documentation |
This is an autoregressive classification model for epiprocess::epi_df data. It does "direct" forecasting, meaning that it estimates a class at a particular target horizon.
arx_classifier(
epi_data,
outcome,
predictors,
trainer = logistic_reg(),
args_list = arx_class_args_list()
)
epi_data |
An |
outcome |
A character (scalar) specifying the outcome (in the
|
predictors |
A character vector giving column(s) of predictor variables.
This defaults to the |
trainer |
A |
args_list |
A list of customization arguments to determine
the type of forecasting model. See |
A list with (1) predictions
an epi_df
of predicted classes
and (2) epi_workflow
, a list that encapsulates the entire estimation
workflow
arx_class_epi_workflow()
, arx_class_args_list()
tiny_geos <- c("as", "mp", "vi", "gu", "pr")
jhu <- covid_case_death_rates %>%
filter(time_value >= as.Date("2021-11-01"), !(geo_value %in% tiny_geos))
out <- arx_classifier(jhu, "death_rate", c("case_rate", "death_rate"))
out <- arx_classifier(
jhu,
"death_rate",
c("case_rate", "death_rate"),
trainer = parsnip::multinom_reg(),
args_list = arx_class_args_list(
breaks = c(-.05, .1), ahead = 14,
horizon = 14, method = "linear_reg"
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.