BasicTS (Basic Time Series) is an open-source PyTorch-based benchmark and toolbox for time series . At present, it only focuses on time series forecasting, and may add time series classification, anomaly detection, etc., in the future.
BasicTS provides users with a unified, standard pipeline, which provides reproduction and fair comparision of popular deep learning-based time series models to inspire new innovations.
BasicTS is developed based on EasyTorch [2], an easy-to-use and powerful open source neural network training framework.
If this repository helps your research or work, I hope you could give me a ⭐, and I will keep updating it. If you need more features about BasicTS (e.g. more datasets or methods) or have any questions/suggestions, please feel free to let me know~
Model\Dataset | METR-LA | PEMS-BAY | PEMS04 | PEMS08 | PEMS03 | PEMS07 | Other Datasets |
---|---|---|---|---|---|---|---|
AR | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
VAR | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
HI | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
Graph WaveNet | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
DCRNN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
STGCN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
StemGNN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
MTGNN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
GTS | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
DGCRN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
GMAN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
AGCRN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
STNorm | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
STID | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
D2STGNN | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
Other Models |
Although we have tried our best to tune the hyperparameters in basicts/options
for every model and every dataset, there is no guarantee that they are optimal.
Thus, any PRs for better hyper-parameters are welcomed to make BasicTS fairer.
🕐
We recommend that you install all dependencies by:
pip install -r requirements.txt
🕐
git clone https://github.com/zezhishao/BasicTS.git
You can download the raw datasets at Google Drive or Baidu Yun(password: 0lrk), and unzip them to datasets/raw_data/
.
cd /path/to/project
python scripts/data_preparation/$DATASET_NAME/generate_training_data.py
Replace $DATASET_NAME
with one of METR-LA
, PEMS-BAY
, PEMS03
, PEMS04
, PEMS07
, PEMS08
, or any other supported dataset.
The processed data will be placed in datasets/$DATASET_NAME
.
Details of preprocessing can be found in docs/DataPreparation_CN.md
~(Chinese).
We recommend running a time series model with the following command:
cd /path/to/project
easytrain -c basicts/options/$METHOD_NAME/$METHOD_NAME_$DATASET_NAME.py --gpus '0'
Replace the $METHOD_NAME
and $DATASET_NAME
with any supported method and dataset. For example,
easytrain -c basicts/options/GraphWaveNet/GraphWaveNet_METR-LA.py --gpus '0'
If you need to debug, you could run the basicts/run.py
file.
🕐
- data preparation: data_preparation_CN.md
🕐
- : add the result of STID.
- : revise the data preprocessing of PEMS07, which only contains weekdays.
- : Add detailed documentation and a demo about data preprocessing.
- : Add more multivariate time series datasets: Traffic, Electricity, Exchange-Rate, ETTh1, ETTh2, ETTm1, Weather, Solar-Energy.
- : Different from the existing traffic datasets (PEMS0X, PEMS-BAY, METR-LA), these datasets have multiple usages in the existing datasets, and the baselines that need to be compared in different contexts are different. Therefore, it is necessary to add statistics for all datasets and describe their typical settings case by case.
- : Add statistical information of these dataset, and descibe their typical settings.
- : Support models like ASTGCN, ASTGNN, which take multi-periodicities data as input.
- : Add detailed docs about 4.2, e.g., the usage of gpu.
- : Update D2STGNN arch.
- : 模块化train_iters, val_iters, and test_iters中的过程。否则就会像GTS一样, 一旦模型有一点特殊 (例如多一个返回和不同的loss), 就必须重写整个train_iters, val_iters, and test_iters。
[1] Yuhao Wang. EasyTorch. https://github.com/cnstark/easytorch, 2020.