PyTorch implementation of the paper-"Human Mobility Prediction with Causal and Spatial-constrained Multi-task Network", accepted by KDD 2022.
We are glad about your interest in our work and we would appreciate it if you cite our paper.
- The processed data can be found in the "data" folder, which was processed by
preproess.py
anddata_prepare.py
. - The raw data can be found at the following open source.
- Python>=3.8
- Pytorch>=1.8.1
- Numpy
- Pandas
/data
: file to store processed data/results
: file to store results such as trained model and metrics.data_preprocess.py
: data preprocessing to filter sparse users and locations (fewer than 10 records) and merge consecutive records (same user and location on the same day).data_prepare.py
: data preparation for CSLSL (split trajectory and generate data).train_test.py
: the entry to train and test a new model.evaluate.py
: the entry to evalute a pretrained model.model.py
: model defination.utils.py
: tools such as batch generation and metric calculation.
- Evaluate a pretrained model
python evaluate.py --data_name NYC --model_name model_NYC
- Train and test a new model
python train_test.py --data_name NYC
Detailed parameter description refers to evaluate.py
and train_test.py