In this sub-scenario, we use and adapt the code repository of the PatchSTG model.
- torch==1.11.0
- timm==1.0.12
- scikit_learn==1.0.2
- tqdm==4.67.1
- pandas==1.4.1
- numpy==1.22.3
└── code-and-data
├── config # Including detail configurations
├── cpt # Storing pre-trained weight files (manually create the folder and download files)
├── data # Including traffic data (download), adj files (generated), and the meta data
├── lib
│ |── utils.py # Codes of preprocessing datasets and calculating metrics
├── log # Storing log files
├── model
│ |── models.py # The core source code of our PatchSTG
├── main.py # This is the main file for training and testing
└── README.md # This documentYou can access the well pre-processed datasets from [Google Drive], then place the downloaded contents under the correspond dataset folder such as ./data/SD.
- Download datasets and place them under
./data - We provide pre-trained weights of results in the paper and the detail configurations under the folder
./config.
To test PatchSTG w/o ST-TTC (i.e., Normal test) on different datasets, First, you should make sure that line 391 in main.py file contains the following:
solver.test()
and then, you can execute the Python file in the terminal:
python main.py --config ./config/CA.conf
python main.py --config ./config/GBA.conf
python main.py --config ./config/GLA.conf
python main.py --config ./config/SD.conf
To test PatchSTG w/ ST-TTC on different datasets, First, you should make sure that line 391 in main.py file contains the following:
solver.test_with_ttc()
and then, you can execute the Python file in the terminal:
python main.py --config ./config/CA.conf
python main.py --config ./config/GBA.conf
python main.py --config ./config/GLA.conf
python main.py --config ./config/SD.conf