A Library for Advanced Deep Time Series Models.
TSlib is an open-source library for deep learning researchers, especially for deep time series analysis.
We provide a neat code base to evaluate advanced deep time series models or develop your model, which covers five mainstream tasks: long- and short-term forecasting, imputation, anomaly detection, and classification.
:triangular_flag_on_post:News (2024.04) Many thanks for the great work from frecklebars. The famous sequenctial model Mamba has been included in our library. See this file, where you need to install mamba_ssm
with pip at first.
:triangular_flag_on_post:News (2024.03) Given the inconsistent look-back length of various papers, we split the long-term forecasting in the leaderboard into two categories: Look-Back-96 and Look-Back-Searching. We recommend researchers read TimeMixer, which includes both settings of the look-back length into experiments for scientific rigor.
:triangular_flag_on_post:News (2023.10) We add an implementation to iTransformer, which is the state-of-the-art model for long-term forecasting. The official code and complete scripts of iTransformer can be found here.
:triangular_flag_on_post:News (2023.09) We added a detailed tutorial for TimesNet and this library, which is quite friendly to beginners of deep time series analysis.
:triangular_flag_on_post:News (2023.02) We release the TSlib as a comprehensive benchmark and code base for time series models, which is extended from our previous GitHub repository Autoformer.
Till March 2024, the top three models for five different tasks are:
Model Ranking |
Long-term Forecasting Look-Back-96 |
Long-term Forecasting Look-Back-Searching |
Short-term Forecasting |
Imputation | Classification | Anomaly Detection |
---|---|---|---|---|---|---|
🥇 1st | iTransformer | TimeMixer | TimesNet | TimesNet | TimesNet | TimesNet |
🥈 2nd | TimeMixer | PatchTST | Non-stationary Transformer |
Non-stationary Transformer |
Non-stationary Transformer |
FEDformer |
🥉 3rd | TimesNet | DLinear | FEDformer | Autoformer | Informer | Autoformer |
Note: We will keep updating this leaderboard. If you have proposed advanced and awesome models, you can send us your paper/code link or raise a pull request. We will add them to this repo and update the leaderboard as soon as possible.
Compared models of this leaderboard. ☑ means that their codes have already been included in this repo.
See our latest paper [TimesNet] for the comprehensive benchmark. We will release a real-time updated online version soon.
Newly added baselines. We will add them to the leaderboard after a comprehensive evaluation.
pip install -r requirements.txt
./dataset
. Here is a summary of supported datasets.
./scripts/
. You can reproduce the experiment results as the following examples:# long-term forecast
bash ./scripts/long_term_forecast/ETT_script/TimesNet_ETTh1.sh
# short-term forecast
bash ./scripts/short_term_forecast/TimesNet_M4.sh
# imputation
bash ./scripts/imputation/ETT_script/TimesNet_ETTh1.sh
# anomaly detection
bash ./scripts/anomaly_detection/PSM/TimesNet.sh
# classification
bash ./scripts/classification/TimesNet.sh
./models
. You can follow the ./models/Transformer.py
.Exp_Basic.model_dict
of ./exp/exp_basic.py
../scripts
.If you find this repo useful, please cite our paper.
@inproceedings{wu2023timesnet,
title={TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis},
author={Haixu Wu and Tengge Hu and Yong Liu and Hang Zhou and Jianmin Wang and Mingsheng Long},
booktitle={International Conference on Learning Representations},
year={2023},
}
If you have any questions or suggestions, feel free to contact:
Or describe it in Issues.
This project is supported by the National Key R&D Program of China (2021YFB1715200).
This library is constructed based on the following repos:
Forecasting: https://github.com/thuml/Autoformer.
Anomaly Detection: https://github.com/thuml/Anomaly-Transformer.
Classification: https://github.com/thuml/Flowformer.
All the experiment datasets are public, and we obtain them from the following links:
Long-term Forecasting and Imputation: https://github.com/thuml/Autoformer.
Short-term Forecasting: https://github.com/ServiceNow/N-BEATS.
Anomaly Detection: https://github.com/thuml/Anomaly-Transformer.
Classification: https://www.timeseriesclassification.com/.