Xiao He, Ye Li, Jian Tan, Bin Wu, Feifei Li. "OneShotSTL: One-Shot Seasonal-Trend Decomposition For Online Time Series Anomaly Detection And Forecasting" in Proceedings of the VLDB Endowment 16, 06 (2023), 1399-1412. Paper
with a Java artifact (java/OneShotSTL/OneShotSTL.jar) and Python scripts/notebooks for reproducing experiments in the paper.
🌟 OneShotSTL is an online/incremental seasonal-trend decomposition method with O(1) update complexity, which can be used for online time series anomaly detection and forecasting.
🌟 It takes around 20 μs for OneShotSTL to process each data point on a typical commodity laptop using a single CPU core.
🌟 On univariate long-term time series forecasting tasks, OneShotSTL is more than 1000 times faster than the state-of- the-art deep learning/Transformer based methods with comparable or even better accuracy.
- Install Python=3.8 and Java
- Install Python requirements
pip install -r requirements.txt
- Download TSB-UAD-Public.zip from TSB-UAD and unzip it into data folder
- Download all_six_datasets.zip from Autoformer and unzip it into data folder
- Preprocess TSB-UAD datasets:
python preprocess_TSB-UAD.py
- Preprocess forecast datasets:
python preprocess_forecast.py
- Synthetic experiments in Figure 5:
exp_synthetic.ipynb
- Scalability experiments in Figure 7:
exp_scalability.ipynb
- Univariate Time Series Anomaly detection experiments in Table 3:
exp_TSB-UAD.ipynb
- Univariate Time Series Forecast experiments in Table 5:
exp_forecast.ipynb
If you would like to modify the java code, you can recompile the maven project as following (maven 3.6.3 is needed):
cd java/OneShotSTL
mvn clean compile assembly:single
mv target/OneShotSTL-1.0-SNAPSHOT-jar-with-dependencies.jar OneShotSTL.jar
If you find this repo useful, please cite our paper.
@article{he2023oneshotstl,
title={{OneShotSTL: One-Shot Seasonal-Trend Decomposition For Online Time Series Anomaly Detection And Forecasting}},
author={He, Xiao and Li, Ye and Tan, Jian and Wu, Bin and Li, Feifei},
journal={Proceedings of the VLDB Endowment},
volume={16},
number={06},
pages={1399--1412},
year={2023},
publisher={VLDB Endowment}.
url={https://www.vldb.org/pvldb/vol16/p1399-he.pdf}
}
If you have any question, please contact xiao_he@me.com