torch_timeseries.dataloader.SlidingWindow

class SlidingWindow(dataset: TimeSeriesDataset, scaler: Scaler, window: int = 168, horizon: int = 3, steps: int = 2, scale_in_train=False, shuffle_train=True, batch_size: int = 32, train_ratio: float = 0.7, val_ratio: float = 0.2, num_worker: int = 3, uniform_eval=True)[source]

Bases: object

Class for splitting the dataset sequentially and then randomly sampling from each subset.

dataset

Time series dataset to be used.

Type:

TimeSeriesDataset

scaler

Scaler to normalize the data.

Type:

Scaler

window

Window size for the time series data.

Type:

int

horizon

Forecast horizon.

Type:

int

steps

Step size between windows.

Type:

int

scale_in_train

Whether to scale data during training.

Type:

bool

shuffle_train

Whether to shuffle the training data.

Type:

bool

batch_size

Number of samples per batch.

Type:

int

train_ratio

Ratio of the dataset to be used for training.

Type:

float

val_ratio

Ratio of the dataset to be used for validation.

Type:

float

test_ratio

Ratio of the dataset to be used for testing.

Type:

float

num_worker

Number of worker threads for data loading.

Type:

int

uniform_eval

Whether to use uniform evaluation.

Type:

bool

train_loader

DataLoader for the training data.

Type:

DataLoader

val_loader

DataLoader for the validation data.

Type:

DataLoader

test_loader

DataLoader for the test data.

Type:

DataLoader