Papers
September 17, 2023 ยท View on GitHub
This is a Pytorch implementation of the following paper:
Papers
[๐งฉ] Spatiotemporal Graph Neural Networks with Uncertainty Quantification for Traffic Incident Risk Prediction
The Code
Requirements
Following is the suggested way to install the dependencies:
conda install --file STTD.yml
Note that pytorch >=1.10.
Folder Structure
โโโ code-and-data
โโโ cta_data_only10 # CDPSAMP10 Dataset as an example
โโโ ny_data_only10 # SLDSAMP10 Dataset as an example
โโโ ny_data_full_5min # SLD_5min Dataset as an example
โโโ ny_data_full_15min # SLD_15min Dataset as an example
โโโ ny_data_full_60min # SLD_60min Dataset as an example
โโโ main_gau.py # STG Model
โโโ main_stnb.py # STNB Model
โโโ main_trunnorm.py # STN Model
โโโ main_zero_NB.py # STZINB Model
โโโ main_tweedie.py # Tweedie Model (STTD, STP, STGM, STIG)
โโโ main_zitd.py # ZI-Tweedie Model
โโโ model.py # The core source code of our model
โโโ utils.py # Defination of auxiliary functions for running
โโโ STTD.yml # The python environment needed for STTD
โโโ pth # Best model save path
โโโ README.md # This document
Datasets
Download datasets from ZhuangDingyi/STZINB: Source code of implementing spatial-temporal zero-inflated negative binomial network for trip demand prediction (github.com)
For London traffic risk dataset, please contact us for more details.
Configuration
Important parameters in the configuration are as follows :
nhid = 42 # The hidden unit
weight_dacay = 1e-4 # Weight decay
learning_rate = 1e-3 # Learning rate
drop_out = 0.2 # Dropout rate
Train and Test
Run python main_{method}.py to train and evaluate the model and generate model prediction .Remember to replace the corresponding data files and output files.