# Time-Series-Library — Advanced Deep Learning Models for Time Series > A comprehensive library of state-of-the-art deep learning models for time series analysis including forecasting, classification, imputation, and anomaly detection. ## Install Save as a script file and run: # Time-Series-Library — Advanced Deep Learning Models for Time Series ## Quick Use ```bash pip install -r requirements.txt python -u run.py --model TimesNet --data ETTh1 --pred_len 96 ``` ## Introduction Time-Series-Library (TSLib) is an open-source Python library from Tsinghua University that provides a unified codebase for advanced deep learning models applied to time series tasks. It enables researchers and practitioners to benchmark and deploy models for forecasting, classification, imputation, and anomaly detection using a consistent interface. ## What Time-Series-Library Does - Implements 15+ state-of-the-art deep time series models (TimesNet, PatchTST, iTransformer, DLinear, and more) - Supports four core tasks: long-term forecasting, short-term forecasting, imputation, and anomaly detection - Provides standardized experiment scripts for reproducible benchmarking - Includes popular time series datasets with unified data loading pipelines - Offers configurable training with GPU acceleration via PyTorch ## Architecture Overview TSLib follows a modular design with separate layers for data loading, model definition, training, and evaluation. Each model implements a common interface, allowing users to switch between architectures by changing a single configuration parameter. The training loop handles multi-GPU setups and supports early stopping, learning rate scheduling, and checkpoint saving. ## Self-Hosting & Configuration - Clone the repo and install dependencies via `pip install -r requirements.txt` - Configure experiments through command-line arguments or shell scripts in the `scripts/` directory - Set `--model` to choose from available architectures (TimesNet, PatchTST, DLinear, FEDformer, etc.) - Adjust `--seq_len`, `--pred_len`, and `--label_len` to control input/output horizons - Place custom datasets in the `dataset/` folder following the provided CSV format ## Key Features - Unified codebase covering multiple time series tasks under one framework - Reproducible baselines with pre-configured experiment scripts - Supports Transformer-based, MLP-based, and CNN-based model families - Active maintenance with new models added as they are published - Clean PyTorch implementation suitable for extension and research ## Comparison with Similar Tools - **Darts** — Higher-level API with statistical and ML models; TSLib focuses on deep learning research - **sktime** — Scikit-learn-compatible framework for classical ML; TSLib targets neural architectures - **GluonTS** — AWS probabilistic forecasting library; TSLib provides a broader model zoo - **NeuralForecast** — Nixtla's neural forecasting; TSLib emphasizes multi-task support beyond forecasting ## FAQ **Q: What Python and PyTorch versions are required?** A: Python 3.8+ and PyTorch 1.8+ are recommended. Check requirements.txt for exact dependencies. **Q: Can I add my own model to TSLib?** A: Yes. Implement the `Model` class interface in the `models/` directory and register it in the experiment runner. **Q: Does it support multivariate time series?** A: Yes. Most models support both univariate and multivariate settings via the `--features` flag (S, M, or MS). **Q: Is GPU training supported?** A: Yes. Use `--use_gpu` and `--gpu` flags to select devices, with multi-GPU support available. ## Sources - https://github.com/thuml/Time-Series-Library - https://arxiv.org/abs/2306.06142 --- Source: https://tokrepo.com/en/workflows/asset-75340a43 Author: Script Depot