numeraire.WalkForwardSplitter#
- class numeraire.WalkForwardSplitter(min_train: int = 60, test_size: int = 12, expanding: bool = True, embargo: int = 0)[source]#
Bases:
objectExpanding- 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 ofmin_trainobservations.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.
Methods
__init__([min_train, test_size, expanding, ...])split(view)Yield
(train, test)view pairs; each test calendar is strictly future of train.Attributes
embargoexpandingmin_traintest_size- split(view: TimeSeriesView) Iterator[tuple[TimeSeriesView, TimeSeriesView]][source]#
Yield
(train, test)view pairs; each test calendar is strictly future of train.