View source: R/get_test_data.R
get_test_data | R Documentation |
Based on the longest lag period in the recipe,
get_test_data()
creates an epi_df
with columns geo_value
, time_value
and other variables in the original dataset,
which will be used to create features necessary to produce forecasts.
get_test_data(recipe, x)
recipe |
A recipe object. |
x |
An epi_df. The typical usage is to pass the same data as that used for fitting the recipe. |
The minimum required (recent) data to produce a forecast is equal to the maximum lag requested (on any predictor) plus the longest horizon used if growth rate calculations are requested by the recipe. This is calculated internally.
An object of the same type as x
with columns geo_value
, time_value
, any additional
keys, as well other variables in the original dataset.
# create recipe
rec <- epi_recipe(covid_case_death_rates) %>%
step_epi_ahead(death_rate, ahead = 7) %>%
step_epi_lag(death_rate, lag = c(0, 7, 14)) %>%
step_epi_lag(case_rate, lag = c(0, 7, 14))
get_test_data(recipe = rec, x = covid_case_death_rates)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.