View source: R/ts-splits-plot.R
ts_splits_plot | R Documentation |
Sometimes we want to see the training and testing data in a plot. This is a
simple wrapper around a couple of functions from the timetk
package.
ts_splits_plot(.splits_obj, .date_col, .value_col)
.splits_obj |
The predefined splits object. |
.date_col |
The date column for the time series. |
.value_col |
The value column of the time series. |
You should already have a splits object defined. This function takes in three parameters, the splits object, a date column and the value column.
A time series cv plan plot
Steven P. Sanderson II, MPH
https://business-science.github.io/timetk/reference/plot_time_series_cv_plan.html(tk_time_sers_cv_plan)
https://business-science.github.io/timetk/reference/plot_time_series_cv_plan.html(plot_time_series_cv_plan)
suppressPackageStartupMessages(library(modeltime))
suppressPackageStartupMessages(library(timetk))
suppressPackageStartupMessages(library(dplyr))
data <- ts_to_tbl(AirPassengers) %>%
select(-index)
splits <- time_series_split(
data
, date_col
, assess = 12
, skip = 3
, cumulative = TRUE
)
ts_splits_plot(
.splits_obj = splits,
.date_col = date_col,
.value_col = value
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.