Code Monkey home page Code Monkey logo

ppr-master's Introduction

PPR-master

The implementation of the PPR model(Personalized POI Recommendation).

Paper Personalized POI Recommendation:Spatio-Temporal Representation Learning with Social Tie was accepted by DASFAA 2021.

Usage:

Install dependencies

pip install -r requirements.txt

Installation

Clone this repo.

git clone https://github.com/dsj96/PPR-master
cd PPR-master
chmod u+x train_PPR.sh

Function

  1. gen_graph.py file is used for heterogeneous graph construction. Parameter theta is $\theta$ in Equ.2, and epsilon is $\varepsilon$ in Equ.6.
  2. reconstruct.cpp file is used for densifying graph. Parameter -threshold is $\rho$.
  3. line.cpp file is used for learning latent representations. Parameter -size is embedding dim $d$.
  4. train.py file is used for training and evaluating the spatio-temporal neural network. Parameter DELT_T is the time constraint $\tau$, and INPUT_SIZE/2 is the embedding dim $d$. You could also change the HIDDEN_SIZE, EPOCH, LR, LAYERS OR TEST_SAMPLE_NUM.

Data

In our experiments, the Foursquare datasets are from https://sites.google.com/site/dbhongzhi/. And the Gowalla and Brightkite dataset are from https://snap.stanford.edu/data/loc-gowalla.html and http://snap.stanford.edu/data/loc-Gowalla.html.

Data Format

We utilize the first 80% chronological check-ins of each user as the training set, the remaining 20% as the test data.

train_checkin_file.txt and test_checkin_file.txt : <USER ID> \t <CHECKIN TIME> \t <POI ID> \t <LONGITUDE> \t <LATITUDE>

friendship_file.txt : <USER ID>,<USER ID>

Training

You can train and evaluate the model by: ./train_PPR.sh

Or you can run the specific program file separately, but the parameters should be reasonable (Although we have set some default parameters).

eg: 
python3 gen_graph.py --input_path dataset/toyset/ --epsilon 0.5 --theta 24.0
python3 train.py --input_path dataset/toyset/ --input_size 16 --hidden_size 16 --layers 2 --lr 0.001 --delt_t 6.0 --epochs 20 --dr 0.2 --seed 1 --test_sample_num 300

Cite

Please cite our paper if you find this code useful for your research:

@inproceedings{dai2021personalized,
  title={Personalized POI Recommendation: Spatio-Temporal Representation Learning with Social Tie.},
  author={Dai, Shaojie and Yu, Yanwei and Fan, Hao and Dong, Junyu},
  booktitle={DASFAA (1)},
  pages={558--574},
  year={2021}
}

ppr-master's People

Contributors

dsj96 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.