View source: R/ts-auto-recipe.R
ts_auto_recipe | R Documentation |
Automatically builds generic time series recipe objects from a given tibble.
ts_auto_recipe(
.data,
.date_col,
.pred_col,
.step_ts_sig = TRUE,
.step_ts_rm_misc = TRUE,
.step_ts_dummy = TRUE,
.step_ts_fourier = TRUE,
.step_ts_fourier_period = 365/12,
.K = 1,
.step_ts_yeo = TRUE,
.step_ts_nzv = TRUE
)
.data |
The data that is going to be modeled. You must supply a tibble. |
.date_col |
The column that holds the date for the time series. |
.pred_col |
The column that is to be predicted. |
.step_ts_sig |
A Boolean indicating should the |
.step_ts_rm_misc |
A Boolean indicating should the following items be removed from the time series signature, default is TRUE.
|
.step_ts_dummy |
A Boolean indicating if all_nominal_predictors() should be dummied and with one hot encoding. |
.step_ts_fourier |
A Boolean indicating if |
.step_ts_fourier_period |
A number such as 365/12, 365/4 or 365 indicting the period of the fourier term. The numeric period for the oscillation frequency. |
.K |
The number of orders to include for each sine/cosine fourier series. More orders increase the number of fourier terms and therefore the variance of the fitted model at the expense of bias. See details for examples of K specification. |
.step_ts_yeo |
A Boolean indicating if the |
.step_ts_nzv |
A Boolean indicating if the |
This will build out a couple of generic recipe objects and return those items in a list.
Steven P. Sanderson II, MPH
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(rsample))
data_tbl <- ts_to_tbl(AirPassengers) %>%
select(-index)
splits <- initial_time_split(
data_tbl
, prop = 0.8
)
ts_auto_recipe(
.data = data_tbl
, .date_col = date_col
, .pred_col = value
)
ts_auto_recipe(
.data = training(splits)
, .date_col = date_col
, .pred_col = value
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.