Skip to content

PyTorch implementation of the paper-"Human Mobility Prediction with Causal and Spatial-constrained Multi-task Network"

License

Notifications You must be signed in to change notification settings

urbanmobility/CSLSL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSLSL

Performances

The latest experimental results are as follows:

Category Location
R@1 R@5 R@10 R@1 R@5 R@10
NYC 0.327 0.661 0.759 0.268 0.568 0.656
TKY 0.448 0.801 0.875 0.240 0.488 0.580
Dallas - - - 0.126 0.243 0.297

Datasets

  • The processed data can be found in the "data" folder, which was processed by data_preproess.py and data_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

  1. Train and test a new model
python train_test.py --data_name NYC 
  1. Evaluate a pretrained model
python evaluate.py --data_name NYC --model_name model_NYC

Detailed parameter description refers to evaluate.py and train_test.py

About

PyTorch implementation of the paper-"Human Mobility Prediction with Causal and Spatial-constrained Multi-task Network"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages