create_cv
Build a time-series cross-validation strategy for a forecasting plan, configure folds, gaps, refit, and training size, then get a CV id for backtesting.
Instructions
Build a time series cross-validation strategy (TimeSeriesFold) for a plan. The response states its cost in cost. Returns a cv id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gap | No | Observations between the end of training and the test set. Null for 0. A direct forecaster (ForecasterDirect, ForecasterDirectMultiVariate) cannot be backtested with a gap. | |
| refit | No | Whether to train again in every fold (true), never (false) or every n folds (an integer). Null for false: train once. Refitting multiplies the cost; ForecasterStats is refitted in every fold whatever it says. | |
| plan_id | Yes | Id of the plan to backtest (from `plan` or `refine_plan`). | |
| skip_folds | No | Folds are numbered from 0, and fold 0 always runs. An integer n keeps folds 0, n, 2n, ...; a list skips the folds at those numbers (each at least 1 and below the number of folds). Null for every fold. | |
| fold_stride | No | Observations the test set advances between folds. Null for `steps` (back-to-back folds); a larger value means fewer folds. | |
| fixed_train_size | No | Whether the training window keeps its size when refitting (true) or grows (false). Null for false. Only with `refit` true or an integer: with `refit` false or null it is an error, as it would not run (ForecasterStats aside). | |
| initial_train_size | No | Observations of the first training set (a number), or the ISO 8601 date that ends it ('2005-06-01'). Null for the default: 70 % of the series, at least what the lags need and leaving room for two folds, written as a date when the data has dates. | |
| allow_incomplete_fold | No | Whether the last fold may have fewer than `steps` observations. Null for true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| cost | No | ||
| kind | Yes | ||
| files | No | ||
| links | No | ||
| notices | No | ||
| summary | Yes | ||
| changeable | No | ||
| notices_omitted | No | ||
| values_included | No | ||
| summary_truncated | No |