Here we have implemented various Recommender System algorithms for implicit feedback and sequential recommendation. These algorithms are implemented in Python and TensorFlow. This package aims to provide clear, annotated, and efficient implementations of these algorithms along with wrapper classes and methods for easy experimentation and usage.
This package focuses on recommendations based on sequential and implicit feedback. In these settings there is no explicit numerical rating of items by users - only the record of actions they have taken. Thus there is only observed positive feedback - if a user u
has not interacted with item i
, it could either be because they dislike the item (negative) or they merely have not come upon this item yet (positive).
The algorithms implemented here approach the implicit feedback recommendation problem from a pairwise ranking perspective, where we assume that an item a user has interacted with should be ranked higher than an item that the user has not yet interacted with.
- Bayesian Personalized Ranking (BPR), from 'BPR: Bayesian Personalized Ranking from Implicit Feedback' (Rendle et al. 2009)
- Factorized Personalized Markov Chains (FPMC), from 'Factorizing personalized Markov chains for next-basket recommendation' (Rendle et al. 2010)
- TransRec, from 'Translation-based Recommendation' (He, et al. 2017)
RecSysModels
is on PyPI
, so you can install the package with pip
:
$ pip install recsys_models
Python 3+
(3.6 may be required for Tensorflow-GPU on Windows)tensorflow
ortensorflow-gpu
numpy
pandas
Jupyter
/JupyterLab
(If you want to run the notebook)
See the sample_pipeline Jupyter Notebook
for sample usage. In order to run this, you will need to download the MovieLens 1M Dataset released in 2003 by the wonderful folks at the GroupLens Lab at the University of Minnesota.
For interoperability, this package supports initializing a model with pretrained weights in the form of numpy
arrays exported from models trained under other frameworks. Please see individual model files (e.g. BPR) for a description of trainable variables and their shapes.