TSLib is a Python library to train, evaluate, and compare deep models on time series tasks including forecasting, imputation, anomaly detection, and classification.
Overview
Time Series Library (TSLib) targets deep learning researchers who need a shared codebase for time series analysis. It packages experiment runners, datasets, and many published model implementations so results can be compared on common benchmarks.
Five task types are covered: long- and short-term forecasting, imputation, anomaly detection, and classification. Scripts under the scripts folder reproduce paper settings, while run.py selects the right experiment class, builds data loaders, instantiates models, and writes metrics and checkpoints.
The models folder holds architecture implementations; reusable attention, convolution, and frequency blocks live in layers. Data loading handles windowing, masking, and task-specific sampling options. A leaderboard tracks model rankings across tasks, and newer additions include zero-shot forecasting hooks for large time series models.
Setup uses Conda, PyTorch with a CUDA version matching your GPU, and optional extras for Mamba or Moirai components. Docker deployment is documented for a containerized workflow. Researchers can add new models by following existing templates and wiring new shell scripts.
Key features
- Five time series task types
- Unified train and evaluate pipeline
- Many baseline model implementations
- Reproducible experiment scripts
- Zero-shot forecasting support
- Shared layers and data providers
- Public leaderboard comparisons
- Docker deployment option
Use cases
- Benchmarking forecasting models
- Research on anomaly detection
- Time series classification studies
- Developing new deep TS architectures
- Reproducing published model results