All of the codes to run the models and processing are located in codes
folder.
- At first step, we need to run the contextual models to get the preference scores of users on POIs based on each contextual influence. To do this, we provide all the contextual models in the
contextsModels
package which are inlib
. When you runsaveScores.py
, all contextual models which are located inlib
compute the users' preference score, then they will be saved asNumPy arrays (.npy)
in/model_combiner/contexts/dataset
and the dataset can beYelp
orGowalla
, indicates on which dataset your run the models and get these results. The size of these producesNumPy arrays
is equal touser_num * poi_num
. - The second step is the embedding of users and POIs that we need them as for the embedding layer of user and POIs in Neural Network based approaches. To embed the user and location into the latent feature space, you can run the
embedding.py
from theMFEmbedder
package. the output is two Numpy arraysU.npy
andL.npy
which are saved in/embeddings/dataset/
. - Run the base models (MF and NN) to achive results on linear and non-linear models. To do this, you can run
main.py
incodes
and save the results automatically toNumpy arrays
. All of this process will be done automatically with code, for example, forNeural Network
based models the code first loads theembedding
vectors of users and items. - Combine all possible combination of MF and NN models with contextual models separately. In order to combine differenc contextual models with each other and also linear and non-linear models we can use the code on the
model_cobiner
package. What we need to do is to config the model to evaluate models and context. Inmodel_combiner.py
we can define our specific configuration, we can select the dataset, base models, contextual models. Then, the results will be written under theresults
folder.
In the next version of our codes, we are going to make it easier to run, using the command-line arguments.
You will need below libraries to be installed before running the application:
- Python >= 3.8
- Numpy >= 1.17.3
- Tensorflow >= 2.2.0
- SciPy >= 1.4.1
For a simple solution, you can simply run the below command in the root directory:
pip install -r prerequisites.txt
If you find ContextsPOI useful for your research or development, please cite the following paper:
@article{rahmani2022context,
title={A Systematic Analysis on the Impact of Contextual Information on Point-of-Interest Recommendation},
author={Rahmani, Hossein A. and Aliannejadi, Mohammad and Baratchi, Mitra and Crestani, Fabio},
journal={ACM Transactions on Information Systems (TOIS)},
volume={-},
number={-},
pages={--},
year={2022},
publisher={ACM New York, NY}
}
- Hossein A. Rahmani, Web Intelligence Group, University College London, United Kingdom (h.rahmnai@ucl.ac.uk)
- Mohammad Aliannejadi, IRLab, University of Amsterdam, The Netherlands (m.aliannejadi@uva.nl)
- Mitra Baratchi, ADA Research Group, Leiden University, The Netherlands (m.baratchi@liacs.leidenuniv.nl)
- Fabio Crestani, IR-USI, Università della Svizzera italiana (USI), Switzerland (fabio.crestani@usi.ch)
If you have any questions, do not hesitate to contact us at rahmanidashti@gmail.com
, we will be happy to assist.
This work was in part supported by the Swiss State Secretariat for Education, Research and Innovation (SERI) mobility grant between Switzerland and Iran, and in part by the NWO (No. 016.Vidi.189.039 and No. 314-99-301).