Source code and data from the RecSys 2020 article "Carousel Personalization in Music Streaming Apps with Contextual Bandits" by W. Bendada, G. Salha and T. Bontempelli

Overview

Carousel Personalization in Music Streaming Apps with Contextual Bandits - RecSys 2020

This repository provides Python code and data to reproduce experiments from the article Carousel Personalization in Music Streaming Apps with Contextual Bandits published in the proceedings of the 14th ACM Conference on Recommender Systems (RecSys 2020 - Best Short Paper Candidate).

Carousel Personalization

Media services providers, such as the music streaming platform Deezer, often leverage swipeable carousels to recommend personalized content to their users. These carousels are ranked lists of L items or cards from a substantially larger catalog (of size K), e.g. L albums, artists or playlists recommended on the homepage of the Deezer app. Only a few cards, say L_init < L, are initially displayed to users, who can swipe the screen to see additional cards.

Selecting the most relevant content to display in carousels is a challenging task, as the catalog is large and as users have different preferences. Also, ranking matters: some cards might not be seen by some users due to the swipeable structure.

In Section 2 of our RecSys paper, we model carousel personalization as a multi-armed bandit problem with multiple plays, cascade-based updates, delayed batch feedback and contextual information on users. We aim at capturing the most important characteristics of real-world swipeable carousels.

Then, we evaluate our framework by addressing a carousel-based playlist recommendation task on Deezer. We selected K = 862 playlists, that were created by professional curators from Deezer with the purpose of complying with a specific music genre, cultural area or mood, and that are among the most popular ones on the service. Playlists' cover images constitute the cards that can be recommended to users on the app homepage in a carousel, updated on a daily basis, with L = 12 available slots and L_init = 3 cards initially displayed. We aim at maximizing display-to-stream rates i.e. at identifying the L cards on which each user is the most likely to click and then to stream the underlying content, at least once during the round (= binary reward of 1 for each streamed playlist).

To determine which method (among the several bandit-based strategies mentioned in the paper - see table below) would best succeed in making users stream the recommended playlists, extensive experiments were conducted in two steps:

  • First, offline experiments simulating the responses of 974 960 users (anonymized) to carousel-based recommendations were run, on a simulation environment and on data that we both publicly release in this repository.
  • In the paper, these experiments were completed by an online A/B test on the Deezer app.

Installation

Code

git clone https://github.com/deezer/carousel_bandits
cd carousel_bandits

Requirements: python 3, matplotlib, numpy, pandas, scipy, seaborn

Data

We release two datasets, detailed in Section 3.2 of the paper:

  • user_features.csv: a dataset of 974 960 fully anonymized Deezer users. Each user is described by:
    • a 96-dimensional embedding vector (fields dim_0 to dim_95), to which we subsequently add a bias term in our code, summarizing the user's musical preferences (see paper for details on computations of embedding vectors)
    • a segment: a k-means clustering with k = 100 clusters was performed internally, to also assign a segment to each user, as required by policies implementing our proposed semi-personalization strategy
  • playlist_features.csv: a dataset of 862 playlists. Each playlist i is described by:
    • a 97-dimensional weight vector, corresponding to the theta_i vectors from Section 3.2 of the paper (see paper for details on computations of weight vectors). For each user-playlist pair (u,i), the released "ground-truth" display-to-stream probability is as follows, where the 97-dimensional x_u vector corresponds to the concatenation of the 96-dim embedding vector of user u and of the bias term, and where sigma denotes the sigmoid activation function:

Download complete datasets

Due to size restrictions, this repository only provides the playlist_features.csv dataset and a very small version of the user dataset with 9 users, named user_features_small.csv, in the data folder.

The complete user_features.csv dataset with 974 960 users is available for download on Zenodo.

Please download it there and subsequently place it in the data folder.

Run Offline Experiments

Simulations proceed as detailed in Section 3.2 of the paper.

Type in the following commands to run offline experiments with similar hyperparameters w.r.t. the paper.

General Experiments (Figure 2 of RecSys paper)

Offline evaluation of Top-12 playlist recommendation: expected cumulative regrets of policies over 100 simulated rounds.

Evaluation of all policies on user_features_small.csv (useful for quick testing)

python main.py --users_path data/user_features_small.csv --policies random,etc-seg-explore,etc-seg-exploit,epsilon-greedy-explore,epsilon-greedy-exploit,kl-ucb-seg,ts-seg-naive,ts-seg-pessimistic,ts-lin-naive,ts-lin-pessimistic --n_users_per_round 9 --output_path general_experiment_results.json
python plot_results.py --data_path general_experiment_results.json

Evaluation of two different policies (random, ts-seg-pessimistic) on the complete user_features.csv

python main.py --policies random,ts-seg-pessimistic --print_every 5 --output_path general_experiment_results.json
python plot_results.py --data_path general_experiment_results.json

Evaluation of all policies on the complete user_features.csv (takes some time!)

python main.py --policies random,etc-seg-explore,etc-seg-exploit,epsilon-greedy-explore,epsilon-greedy-exploit,kl-ucb-seg,ts-seg-naive,ts-seg-pessimistic,ts-lin-naive,ts-lin-pessimistic --print_every 1 --output_path general_experiment_results.json
python plot_results.py --data_path general_experiment_results.json

Note on running times: the ts-lin-naive and ts-lin-pessimistic policies might take a few minutes per round on a regular laptop. To speed up computations, you might consider removing them from the list of evaluated policies.

Results should look like:

Important note on ts-lin policies: our implementation of naive and pessimistic linear Thompson Sampling strategies have been improved since the publication of the RecSys paper. As a consequence, regret curves from these two policies are a bit different than in Figure 2 of the paper (results are better). Nonetheless, all conclusions from the article remain valid, especially regarding the comparison with ts-seg-pessimistic, and the comparison among ts-lin-naive and ts-lin-pessimistic.

Cascade vs No-Cascade Experiments (Figure 3 of RecSys paper)

Comparison of cascade vs no-cascade policies for epsilon-greedy and ts-seg-pessimistic policies, over 100 simulated rounds.

We provide comments on our implementation of a cascade-based behaviour for these experiments in policies.py.

python main.py --policies epsilon-greedy-explore,epsilon-greedy-explore-no-cascade,ts-seg-pessimistic,ts-seg-pessimistic-no-cascade --print_every 5 --output_path cascade_experiment_results.json
python plot_results.py --data_path cascade_experiment_results.json

Results should look like:

Complete list of main.py parameters

Parameter Type Description Default Value
users_path string Path to user features file data/user_features.csv
playlists_path string Path to playlist features file data/playlist_features.csv
output_path string Path to a json file to save regret values of each policy accross time results.json
policies string List of bandit policies to evaluate, separated by commas, among:
- random
- etc-seg-explore
- etc-seg-exploit
- epsilon-greedy-explore
- epsilon-greedy-exploit
- kl-ucb-seg
- ts-seg-naive
- ts-seg-pessimistic
- ts-lin-naive
- ts-lin-pessimistic
- epsilon-greedy-explore-no-cascade
- ts-seg_pessimistic-no-cascade
Please see Section 3 of the RecSys paper for details on policies. New policies must be implemented in policies.py and then defined in the set_policies function from main.py.
random,ts-seg-naive
n_recos int Number of slots L in the carousel i.e. number of recommendations that each policy must provide to users at each round 12
l_init int Number of slots L_init initially visible in the carousel 3
n_users_per_round int Number of users drawn on the random subsets of users selected at each round.
Note: users are drawn with replacement, implying that some users might click on several playlists during a same round (multi-armed bandit with multiple plays setting)
20 000
n_rounds int Number of simulated rounds 100
print_every int Print cumulative regrets of all policies every print_every round 10

Cite

Please cite our paper if you use this code or data in your own work:

@inproceedings{bendada2020carousel,
  title={Carousel Personalization in Music Streaming Apps with Contextual Bandits},
  author={Bendada, Walid and Salha, Guillaume and Bontempelli, Theo},
  booktitle={14th ACM Conference on Recommender Systems (RecSys 2020)},
  year={2020}
}
Owner
Deezer
Deezer
A PaddlePaddle version image model zoo.

Paddle-Image-Models English | 简体中文 A PaddlePaddle version image model zoo. Install Package Install by pip: $ pip install ppim Install by wheel package

AgentMaker 131 Dec 07, 2022
PyTorch implementation of 'Gen-LaneNet: a generalized and scalable approach for 3D lane detection'

(pytorch) Gen-LaneNet: a generalized and scalable approach for 3D lane detection Introduction This is a pytorch implementation of Gen-LaneNet, which p

Yuliang Guo 233 Jan 06, 2023
JAXMAPP: JAX-based Library for Multi-Agent Path Planning in Continuous Spaces

JAXMAPP: JAX-based Library for Multi-Agent Path Planning in Continuous Spaces JAXMAPP is a JAX-based library for multi-agent path planning (MAPP) in c

OMRON SINIC X 24 Dec 28, 2022
BARF: Bundle-Adjusting Neural Radiance Fields 🤮 (ICCV 2021 oral)

BARF 🤮 : Bundle-Adjusting Neural Radiance Fields Chen-Hsuan Lin, Wei-Chiu Ma, Antonio Torralba, and Simon Lucey IEEE International Conference on Comp

Chen-Hsuan Lin 539 Dec 28, 2022
DiSECt: Differentiable Simulator for Robotic Cutting

DiSECt: Differentiable Simulator for Robotic Cutting Website | Paper | Dataset | Video | Blog post DiSECt is a simulator for the cutting of deformable

NVIDIA Research Projects 73 Oct 29, 2022
PyTorch3D is FAIR's library of reusable components for deep learning with 3D data

Introduction PyTorch3D provides efficient, reusable components for 3D Computer Vision research with PyTorch. Key features include: Data structure for

Facebook Research 6.8k Jan 01, 2023
Code for testing convergence rates of Lipschitz learning on graphs

📈 LipschitzLearningRates The code in this repository reproduces the experimental results on convergence rates for k-nearest neighbor graph infinity L

2 Dec 20, 2021
Funnels: Exact maximum likelihood with dimensionality reduction.

Funnels This repository contains the code needed to reproduce the experiments from the paper: Funnels: Exact maximum likelihood with dimensionality re

2 Apr 21, 2022
A cool little repl-based simulation written in Python

A cool little repl-based simulation written in Python planned to integrate machine-learning into itself to have AI battle to the death before your eye

Em 6 Sep 17, 2022
Unifying Global-Local Representations in Salient Object Detection with Transformer

GLSTR (Global-Local Saliency Transformer) This is the official implementation of paper "Unifying Global-Local Representations in Salient Object Detect

11 Aug 24, 2022
Aspect-Sentiment-Multiple-Opinion Triplet Extraction (NLPCC 2021)

The code and data for the paper "Aspect-Sentiment-Multiple-Opinion Triplet Extraction" Requirements Python 3.6.8 torch==1.2.0 pytorch-transformers==1.

慢半拍 5 Jul 02, 2022
Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Volume rendering + 3D implicit surface Showcase What? previous: surface rendering; now: volume rendering previous: NeRF's volume density; now: implici

Jianfei Guo 682 Jan 04, 2023
In this project we investigate the performance of the SetCon model on realistic video footage. Therefore, we implemented the model in PyTorch and tested the model on two example videos.

Contrastive Learning of Object Representations Supervisor: Prof. Dr. Gemma Roig Institutions: Goethe University CVAI - Computational Vision & Artifici

Dirk Neuhäuser 6 Dec 08, 2022
A annotation of yolov5-5.0

代码版本:0714 commit #4000 $ git clone https://github.com/ultralytics/yolov5 $ cd yolov5 $ git checkout 720aaa65c8873c0d87df09e3c1c14f3581d4ea61 这个代码只是注释版

Laughing 229 Dec 17, 2022
NumPy로 구현한 딥러닝 라이브러리입니다. (자동 미분 지원)

Deep Learning Library only using NumPy 본 레포지토리는 NumPy 만으로 구현한 딥러닝 라이브러리입니다. 자동 미분이 구현되어 있습니다. 자동 미분 자동 미분은 미분을 자동으로 계산해주는 기능입니다. 아래 코드는 자동 미분을 활용해 역전파

조준희 17 Aug 16, 2022
Instant-nerf-pytorch - NeRF trained SUPER FAST in pytorch

instant-nerf-pytorch This is WORK IN PROGRESS, please feel free to contribute vi

94 Nov 22, 2022
Greedy Gaussian Segmentation

GGS Greedy Gaussian Segmentation (GGS) is a Python solver for efficiently segmenting multivariate time series data. For implementation details, please

Stanford University Convex Optimization Group 72 Dec 07, 2022
The code for SAG-DTA: Prediction of Drug–Target Affinity Using Self-Attention Graph Network.

SAG-DTA The code is the implementation for the paper 'SAG-DTA: Prediction of Drug–Target Affinity Using Self-Attention Graph Network'. Requirements py

Shugang Zhang 7 Aug 02, 2022