Splitters#

The sktime.split module contains algorithms for splitting and resampling data.

All splitters in sktime can be listed using the sktime.registry.all_estimators utility, using estimator_types="splitter", optionally filtered by tags. Valid tags can be listed using sktime.registry.all_tags.

Splitting utilities#

temporal_train_test_split is a quick utility function for splitting a single time series into training and test fold.

Forecasting users interested in performance evaluation are advised to use full backtesting instead of a single split, e.g., via evaluate, see forecasting API reference.

temporal_train_test_split(y[, X, test_size, ...])

Split time series data containers into a single train/test split.

Time index splitters#

Time index splitters split one or multiple time series by temporal order. They are typically used in both evaluation and tuning of forecasters. They have tag "split_type"="temporal".

CutoffSplitter(cutoffs[, fh, window_length])

Cutoff window splitter.

SingleWindowSplitter(fh[, window_length])

Single window splitter.

SlidingWindowSplitter([fh, window_length, ...])

Sliding window splitter.

ExpandingWindowSplitter([fh, ...])

Expanding window splitter.

ExpandingGreedySplitter(test_size[, folds, ...])

Splitter that successively cuts test folds off the end of the series.

TemporalTrainTestSplitter([train_size, ...])

Temporal train-test splitter, based on sample sizes of train or test set.

Time index splitter composition#

The following splitters are compositions that can be used to create more complex time index based splitting strategies.

Repeat(splitter[, times, mode, random_repeat])

Add repetitions to a splitter, element-wise or sequence-wise.

SameLocSplitter(cv[, y_template])

Splitter that replicates loc indices from another splitter.

TestPlusTrainSplitter(cv)

Splitter that adds the train sets to the test sets.

Instance splitters#

Instance splitters split panels or hierarchical time series by the instance index, i.e., identifiers for entire series. Train and test sets contain entire series from the original panel. Instance splitters have tag "split_type"="instance".

InstanceSplitter(cv)

Splitter that applies an sklearn instance splitter to a panel of time series.