SlidingWindowSplitter

class sktime.forecasting.model_selection.SlidingWindowSplitter(fh=1, window_length=10, step_length=1, initial_window=None, start_with_window=False)[source]

Sliding window splitter

Parameters
  • fh (int, list or np.array) – Forecasting horizon

  • window_length (int) –

  • step_length (int) –

  • initial_window (int) –

  • start_with_window (bool, optional (default=False)) –

Examples

For example for window_length = 5, step_length = 1 and fh = 3 here is a representation of the folds:

|-----------------------|
| * * * * * x x x - - - |
| - * * * * * x x x - - |
| - - * * * * * x x x - |
| - - - * * * * * x x x |

* = training fold.

x = test fold.

__init__(fh=1, window_length=10, step_length=1, initial_window=None, start_with_window=False)[source]

Initialize self. See help(type(self)) for accurate signature.