numeraire.core.splitter.WalkForwardSplitter#

class numeraire.core.splitter.WalkForwardSplitter(min_train: int = 60, test_size: int = 12, expanding: bool = True, embargo: int = 0)[source]#

Bases: object

Expanding- or rolling-window walk-forward splitter.

Parameters:
  • min_train (int) – Minimum number of calendar observations in the first train fold.

  • test_size (int) – Number of calendar observations per test fold (also the step between folds).

  • expanding (bool) – True → train grows from the start each fold; False → rolling window of min_train observations.

  • embargo (int) – Extra calendar observations to drop between the train cutoff and the first test date, on top of the automatic horizon purge. Default 0.

__init__(min_train: int = 60, test_size: int = 12, expanding: bool = True, embargo: int = 0) None#

Methods

__init__([min_train, test_size, expanding, ...])

split(view)

Yield (train, test) view pairs; each test calendar is strictly future of train.

Attributes

embargo

expanding

min_train

test_size

split(view: TimeSeriesView) Iterator[tuple[TimeSeriesView, TimeSeriesView]][source]#

Yield (train, test) view pairs; each test calendar is strictly future of train.