SlideWin#
- class dpeeg.transforms.SlideWin(win: int, overlap: int = 0)[source]#
Apply a sliding window to the dataset.
This transform is only splits the time series (dim = -1) through the sliding window operation on the original dataset. If the time axis is not divisible by the sliding window, the last remaining time data will be discarded. Applied to edata and label by default.
- Parameters:
- Returns:
data – Transformed eegdata.
- Return type:
eegdata or dataset
Examples
>>> eegdata = dpeeg.EEGData(edata=np.random.randn(16, 3, 10), ... label=np.random.randint(0, 3, 16)) >>> transforms.SlideWin(3, 1)(eegdata, verbose=False) [edata=(64, 3, 3), label=(64,)]