CSLSL
May 29, 2022 ยท View on GitHub
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.
Datasets
- The processed data can be found in the "data" folder, which was processed by
preproess.pyanddata_prepare.py. - The raw data can be found at the following open source.
Requirements
- Python>=3.8
- Pytorch>=1.8.1
- Numpy
- Pandas
Project Structure
/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.
Usage
- 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