tidy.frosting | R Documentation |
tidy
will return a data frame that contains information
regarding a frosting or operation within the frosting (when a tidy
method for the operation exists). Note that this is a modified
version of the tidy
method for a recipe.
## S3 method for class 'frosting'
tidy(x, number = NA, id = NA, ...)
x |
A |
number |
An integer or |
id |
A character string or |
... |
Not currently used. |
A tibble with columns that vary depending on what
tidy
method is executed. When number
, and id
are NA
, a
tibble with columns number
(the operation iteration),
operation
("layer"),
type
(the method, e.g. "predict", "naomit"), and a character column id
.
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) %>%
step_epi_naomit()
wf <- epi_workflow(r, parsnip::linear_reg()) %>% fit(jhu)
latest <- get_test_data(recipe = r, x = jhu)
f <- frosting() %>%
layer_predict() %>%
layer_naomit(.pred)
tidy(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.