Overview
Dataset class for TinyTimeMixer, a lightweight and efficient time series forecasting model.Class signature
Parameters
Dataset name.
Column containing datetimes.
Path to CSV file.
Train/val/test split boundaries. Default splits as: 50% train, 20% val, 30% test.
Batch size.
Mode of use:
'train', 'val', or 'test'.Stride for windowing.
Historical context length.
Forecast horizon length.
Methods
__len__()
Get the total number of data samples.
int - Number of samples available for iteration.
__getitem__(index)
Get a data chunk for the given index.
index(int): Index of the data chunk.
input_seq(np.ndarray): Input sequence of shape(num_channels, context_len)forecast_seq(np.ndarray): Forecast sequence of shape(num_channels, horizon_len)
get_data_loader()
Get a data loader for the dataset.
DataLoader - PyTorch DataLoader for the dataset.
Example usage
Features
- Efficient chunking for multivariate time series (max 64 channels per chunk)
- Automatic padding for short sequences
- High batch size support (default 128) for fast training
- Simple and clean data interface
- Automatic horizon length adjustment (max 30% of data length)
Data format
Input shape
(num_channels, context_len) - Multiple time series channels with historical context
Output shape
(num_channels, horizon_len) - Forecast for each channel
Notes
- The dataset automatically adjusts horizon length to be at most 30% of the data length
- Supports special boundary values:
[-1, -1, -1]uses all data for training - Data is chunked into groups of up to 64 channels for efficient processing
- No normalization is applied by default (raw data is used)