Back to models
Splitter

ExpandingGreedySplitter

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

Quickstart

python
from sktime.split.expandinggreedy import ExpandingGreedySplitter

estimator = ExpandingGreedySplitter(test_size: int | float, folds: int=5, step_length: int | None=None)

Parameters(3)

test_sizeint or float
If int: the number of steps included in the test set of each fold.

Formally, steps are consecutive iloc indices.

foldsint, default = 5
The number of folds.
step_lengthint, optional

The number of steps advanced for each fold. Defaults to test_size.

Examples

>>> import numpy as np
>>> from sktime.split import ExpandingGreedySplitter
>>> ts = np. arange (10)
>>> splitter = ExpandingGreedySplitter (test_size = 3, folds = 2)
>>> list (splitter. split (ts)) [(array([0, 1, 2, 3]), array([4, 5, 6])), (array([0, 1, 2, 3, 4, 5, 6]), array([7, 8, 9])) ]