Description Usage Arguments Value Examples
Plot datasets with lagged features to view ther direct forecasting setup across horizons.
1 2 |
x |
An object of class 'lagged_df' from |
... |
Not used. |
A single plot of class 'ggplot' if lookback
was specified in create_lagged_df()
;
a list of plots, one per feature, of class 'ggplot' if lookback_control
was specified.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")
#------------------------------------------------------------------------------
# Example 1 - Training data for 3 horizon-specific models w/ common lags per predictor.
horizons <- c(1, 6, 12)
lookback <- 1:15
data_train <- create_lagged_df(data_seatbelts, type = "train", outcome_col = 1,
lookback = lookback, horizon = horizons)
plot(data_train)
#------------------------------------------------------------------------------
# Example 2 - Training data for one 3-month horizon model w/ unique lags per predictor.
horizons <- 3
lookback <- list(c(3, 6, 9, 12), c(4:12), c(6:15), c(8))
data_train <- create_lagged_df(data_seatbelts, type = "train", outcome_col = 1,
lookback_control = lookback, horizon = horizons)
plot(data_train)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.