Overview
Dataset class for LPTM models, supporting forecasting, imputation, detection, and classification tasks.Class signature
Parameters
Name of the dataset. Used to locate data automatically.
Name of the datetime column in the CSV file.
Path to the dataset CSV file. If None, uses the loader function for
name.Batch size for DataLoader.
Mode of operation:
'train' or 'test'.Train/val/test split boundaries. Default splits as: 60% train, 20% val, 20% test.
Forecast horizon length.
Task type:
'forecasting', 'imputation', 'forecasting2', 'detection', or 'classification'.Column name for labels in classification tasks. Defaults to
'label' if not provided.Stride for windowing time series data.
Sequence length for input windows.
Extra backend-specific options.
Methods
__len__()
Get the total number of data samples.
int - Number of samples available for iteration.
__getitem__(index)
Get a data sample by index.
index(int): Index of the data sample.
get_data_loader()
Get a DataLoader for the dataset.
DataLoader - PyTorch DataLoader for the dataset.
Example usage
Task-specific outputs
Forecasting
Returns:(input_seq, input_mask, forecast_seq)
Imputation
Returns:(input_seq, input_mask)
Detection
Returns:(input_seq, input_mask, labels)
Classification
Returns:(input_seq, input_mask, labels)