Description
LTSF-Linear provides the official PyTorch implementation for the research paper "Are Transformers Effective for Time Series Forecasting?", presented at AAAI-2023. This repository focuses on a family of linear models designed to address the challenges of long-term time series forecasting (LTSF), demonstrating superior performance compared to transformer-based architectures.
Read More
The LTSF-Linear family includes three core models: Linear, NLinear, and DLinear. The basic Linear model is a single-layer linear model that surprisingly outperforms complex transformers. NLinear enhances performance by normalizing inputs to handle distribution shifts between training and testing sets. DLinear combines a decomposition scheme with linear layers, separating data into trend and seasonal components for more robust forecasting.
Key advantages of LTSF-Linear include its O(1) maximum signal traversing path length, enabling effective capture of both short-range and long-range temporal dependencies. The models are highly efficient, requiring less memory, fewer parameters, and offering faster inference speeds than transformers. Furthermore, LTSF-Linear models are interpretable, allowing for weight visualization to gain insights into predictions, and are easy to use without extensive hyper-parameter tuning.
The repository also serves as a benchmark for LTSF, supporting both univariate and multivariate forecasting. It includes implementations of several prominent forecasting transformers (Transformer, Informer, Autoformer, Pyraformer, FEDformer) for comparative analysis. Detailed scripts are provided for various experimental setups, including long-term forecasting, the impact of look-back window sizes, and embedding strategies.
This project is valuable for researchers and practitioners in time series analysis, machine learning, and forecasting who are looking for efficient, interpretable, and high-performing solutions for long-term predictions. The inclusion of a benchmark and comparative implementations makes it a comprehensive resource for evaluating forecasting models.
- CategoryAI Models & LLMs
- Pricing ModelOpen source
- DeploymentCloud, Self-hosted
- PlatformsLinux, macOS, Windows
LTSF-Linear's Core Features
Official PyTorch implementation of LTSF-Linear models
Includes Linear, NLinear, and DLinear models
Outperforms transformer-based methods in long-term time series forecasting
Supports univariate and multivariate forecasting
High-efficiency with lower memory and faster inference
O(1) maximum signal traversing path length for dependency capture
Weight visualization for interpretability
Includes benchmark for long-term time series forecasting
Provides implementations of Transformer, Informer, Autoformer, Pyraformer, FEDformer
Scripts for various experimental setups (long-term forecasting, look-back window study)
Easy to use without extensive hyper-parameter tuning
Getting Started with LTSF-Linear
Set up environment: Install Conda, create a virtual environment, and install requirements.
Data preparation: Download benchmark datasets and place them in the './dataset' directory.
Training: Execute provided shell scripts in the './scripts' directory for specific models and datasets.
Model selection: Specify the desired model (Linear, DLinear, NLinear) within the training scripts.
Experimentation: Utilize scripts for long-term forecasting, look-back window studies, and embedding strategies.
Visualization: Run weight plotting scripts to interpret model behavior.
Integration: Adapt training and inference scripts for custom time series forecasting tasks.
LTSF-Linear's Use Cases
- Long-term forecasting
- Univariate forecasting
- Multivariate forecasting
- Trend and seasonality analysis
- Model performance benchmarking
- Interpretable AI







