This is a boilerplate function to create automatically the following:
recipe
model specification
workflow
calibration tibble and plot
Usage
ts_auto_theta(
.data,
.date_col,
.value_col,
.rsamp_obj,
.prefix = "ts_theta",
.bootstrap_final = FALSE
)
Details
This uses the forecast::thetaf()
for the parsnip
engine. This
model does not use exogenous regressors, so only a univariate model of: value ~ date
will be used from the .date_col
and .value_col
that you provide.
See also
https://business-science.github.io/modeltime/reference/exp_smoothing.html#engine-details
https://pkg.robjhyndman.com/forecast/reference/thetaf.html
Other Boiler_Plate:
ts_auto_arima()
,
ts_auto_arima_xgboost()
,
ts_auto_croston()
,
ts_auto_exp_smoothing()
,
ts_auto_glmnet()
,
ts_auto_lm()
,
ts_auto_mars()
,
ts_auto_nnetar()
,
ts_auto_prophet_boost()
,
ts_auto_prophet_reg()
,
ts_auto_smooth_es()
,
ts_auto_svm_poly()
,
ts_auto_svm_rbf()
,
ts_auto_xgboost()
Other exp_smoothing:
ts_auto_croston()
,
ts_auto_exp_smoothing()
,
ts_auto_smooth_es()
Examples
# \donttest{
library(dplyr)
library(timetk)
library(modeltime)
data <- AirPassengers %>%
ts_to_tbl() %>%
select(-index)
splits <- time_series_split(
data
, date_col
, assess = 12
, skip = 3
, cumulative = TRUE
)
ts_theta <- ts_auto_theta(
.data = data,
.date_col = date_col,
.value_col = value,
.rsamp_obj = splits
)
ts_theta$recipe_info
#> $recipe_call
#> recipe(.data = data, .date_col = date_col, .value_col = value,
#> .rsamp_obj = splits)
#>
#> $recipe_syntax
#> [1] "ts_theta_recipe <-"
#> [2] "\n recipe(.data = data, .date_col = date_col, .value_col = value, .rsamp_obj = splits)"
#>
#> $rec_obj
#>
#> ── Recipe ──────────────────────────────────────────────────────────────────────
#>
#> ── Inputs
#> Number of variables by role
#> outcome: 1
#> predictor: 1
#>
# }