A flexible simulation framework for evaluating recommender systems in dynamic environments.
On the right is a visualization of the interaction between environment and recommender.
RecLab also implements many existing recommenders for the purpose of benchmarking. The recommenders include factorization machines, neural models, and simple baseline algorithms.
pip install reclab
RecLab also implements a set of benchmark recommender systems, however the default pip install command will not fetch the necessary dependencies. To fetch these dependencies you must have g++ 5.0 or higher and python3-dev installed. You should then run
pip install reclab[recommenders]
which will install both the core reclab framework and the benchmark recommendation algorithms.
The code below shows a simple use-case with random recommendations.
import numpy as np
import reclab
env = reclab.make('topics-dynamic-v1')
items, users, ratings = env.reset()
for _ in range(1000):
online_users = env.online_users
# Your recommender here. This recommends random items.
recs = np.random.choice(items, size=(len(online_users), 10))
items, users, ratings, info = env.step(recs)
env.close()
To see a description of available environments see the list of environments.
RecLab implements twelve different recommender models for recommendation, though the framework is designed to allow you to easily evaluate a custom model.