crossv_tskfold: Generate cross-validated time-series K-fold test-training...

Description Usage Arguments Details Value Methods (by class) References

Description

Splits data into test/train sets for cross-validating time series data. In each split, the indices are increasing, so only previous data are used to test future data.

Usage

1
2
3
4
5
6
7
crossv_tskfold(data, K, ...)

## S3 method for class 'data.frame'
crossv_tskfold(data, K = 5L, ...)

## S3 method for class 'grouped_df'
crossv_tskfold(data, K = 5L, ...)

Arguments

data

A data frame or vector

K

The number of folds

...

Passed to methods

Details

The data are split into K ≥q 2 folds, where for each i in 2:K, the i-th fold is the test set and folds 1, ..., (i - 1) folds are the training set.

Value

A data frame with K the following columns:

sample

A list of resample objects. Training sets.

.id

An integer vector of identifiers.

Methods (by class)

References


jrnold/resamplr documentation built on May 20, 2019, 1:05 a.m.