SlidingWindowSplitter<T>
Models & Types · AiDotNet.Preprocessing.DataPreparation.Splitting.TimeSeries
Sliding window splitter with fixed-size training window that moves through time.
Inheritance: DataSplitterBase<T> → SlidingWindowSplitter<T>
For Beginners
Unlike the expanding window time series split, a sliding window keeps the training size fixed and “slides” forward through time.
How It Works
How It Works: Notice: Training window is always the same size, just shifted forward.
When to Use:
- When old data becomes less relevant (concept drift)
- When you want fixed compute per training iteration
- When training on recent data only is preferred
Constructors
| Constructor | Summary |
|---|---|
SlidingWindowSplitter() |
Initializes a new instance with default settings. |
SlidingWindowSplitter(int trainSize, int testSize, int? stepSize, int gap) |
Creates a new sliding window splitter. |
Properties
| Property | Summary |
|---|---|
int NumSplits { get; } |
|
string Description { get; } |
Methods
| Method | Summary |
|---|---|
DataSplitResult<T> Split(Matrix<T> X, Vector<T> y) |
|
IEnumerable<DataSplitResult<T>> GetSplits(Matrix<T> X, Vector<T> y) |