Description Usage Arguments Details Value Methods (by class) References
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.
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, ...)
|
data |
A data frame or vector |
K |
The number of folds |
... |
Passed to methods |
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.
A data frame with K
the following columns:
A list of resample
objects. Training sets.
An integer vector of identifiers.
data.frame
: Rows (observations) are split into folds.
The ordering of the data frame is assmed to be meaningful.
grouped_df
: The groups are split into folds. The
ordering of the groups is assumed to be meaningful. No stratification
option is provided since the cases in which stratification can usually
be rewritten to operate on the groups rather than within groups.
Scikit-learn v. 0.18.1. Cross-validation: evaluating estimator performance. URL.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.