cv_ts_folds: Get cross validation folds for time series

Description Usage Arguments Value Examples

View source: R/validation.R

Description

Get cross validation folds for time series

Usage

1
cv_ts_folds(x, start_date, horizon, iterations, jump = horizon)

Arguments

x

(datetime) Vector of dates to create indexes for. Must be ordered.

start_date

(date) Date to start creating folds from.

horizon

(int) Number of days making up each out-of-sample test set.

iterations

(int) Number of training and test sets to create.

jump

(int) Number of days to move forward each iteration. Defaults to the horizon length.

Value

List with train and test elements for each iteration.

Examples

1
2
3
library(lubridate)
dts <- ymd("2019-10-01") + minutes(1)*0:(1441*14-1)
cv_folds <- cv_ts_folds(dts, ymd("2019-10-07"), 2, 3)

gprashal0706/chevckit documentation built on Dec. 20, 2021, 12:45 p.m.