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
Visualizing lattice vibration information from phonon dispersion to atoms (For GPUMD)

Phonon-Vibration-Viewer (For GPUMD) Visualizing lattice vibration information from phonon dispersion for primitive atoms. In this tutorial, we will in

Liangting 6 Dec 10, 2022
Pytorch Lightning Distributed Accelerators using Ray

Distributed PyTorch Lightning Training on Ray This library adds new PyTorch Lightning plugins for distributed training using the Ray distributed compu

167 Jan 02, 2023
Omniverse sample scripts - A guide for developing with Python scripts on NVIDIA Ominverse

Omniverse sample scripts ここでは、NVIDIA Omniverse ( https://www.nvidia.com/ja-jp/om

ft-lab (Yutaka Yoshisaka) 37 Nov 17, 2022
Plenoxels: Radiance Fields without Neural Networks, Code release WIP

Plenoxels: Radiance Fields without Neural Networks Alex Yu*, Sara Fridovich-Keil*, Matthew Tancik, Qinhong Chen, Benjamin Recht, Angjoo Kanazawa UC Be

Alex Yu 2.3k Dec 30, 2022
SlideGraph+: Whole Slide Image Level Graphs to Predict HER2 Status in Breast Cancer

SlideGraph+: Whole Slide Image Level Graphs to Predict HER2 Status in Breast Cancer A novel graph neural network (GNN) based model (termed SlideGraph+

28 Dec 24, 2022
Monocular Depth Estimation - Weighted-average prediction from multiple pre-trained depth estimation models

merged_depth runs (1) AdaBins, (2) DiverseDepth, (3) MiDaS, (4) SGDepth, and (5) Monodepth2, and calculates a weighted-average per-pixel absolute dept

Pranav 39 Nov 21, 2022
A visualization tool to show a TensorFlow's graph like TensorBoard

tfgraphviz tfgraphviz is a module to visualize a TensorFlow's data flow graph like TensorBoard using Graphviz. tfgraphviz enables to provide a visuali

44 Nov 09, 2022
TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

2.6k Jan 04, 2023
Complete* list of autonomous driving related datasets

AD Datasets Complete* and curated list of autonomous driving related datasets Contributing Contributions are very welcome! To add or update a dataset:

Daniel Bogdoll 13 Dec 19, 2022
Weakly Supervised Learning of Rigid 3D Scene Flow

Weakly Supervised Learning of Rigid 3D Scene Flow This repository provides code and data to train and evaluate a weakly supervised method for rigid 3D

Zan Gojcic 124 Dec 27, 2022
Sequence modeling benchmarks and temporal convolutional networks

Sequence Modeling Benchmarks and Temporal Convolutional Networks (TCN) This repository contains the experiments done in the work An Empirical Evaluati

CMU Locus Lab 3.5k Jan 01, 2023
Multi-Glimpse Network With Python

Multi-Glimpse Network Multi-Glimpse Network: A Robust and Efficient Classification Architecture based on Recurrent Downsampled Attention arXiv Require

9 May 10, 2022
My implementation of transformers related papers for computer vision in pytorch

vision_transformers This is my personnal repo to implement new transofrmers based and other computer vision DL models I am currenlty working without a

samsja 1 Nov 10, 2021
The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch.

News December 27: v1.1.0 New loss functions: CentroidTripletLoss and VICRegLoss Mean reciprocal rank + per-class accuracies See the release notes Than

Kevin Musgrave 5k Jan 05, 2023
Code for KDD'20 "Generative Pre-Training of Graph Neural Networks"

GPT-GNN: Generative Pre-Training of Graph Neural Networks GPT-GNN is a pre-training framework to initialize GNNs by generative pre-training. It can be

Ziniu Hu 346 Dec 19, 2022
my graduation project is about live human face augmentation by projection mapping by using CNN

Live-human-face-expression-augmentation-by-projection my graduation project is about live human face augmentation by projection mapping by using CNN o

1 Mar 08, 2022
Dilated RNNs in pytorch

PyTorch Dilated Recurrent Neural Networks PyTorch implementation of Dilated Recurrent Neural Networks (DilatedRNN). Getting Started Installation: $ pi

Zalando Research 200 Nov 17, 2022
Learning to Disambiguate Strongly Interacting Hands via Probabilistic Per-Pixel Part Segmentation [3DV 2021 Oral]

Learning to Disambiguate Strongly Interacting Hands via Probabilistic Per-Pixel Part Segmentation [3DV 2021 Oral] Learning to Disambiguate Strongly In

Zicong Fan 40 Dec 22, 2022
General Virtual Sketching Framework for Vector Line Art (SIGGRAPH 2021)

General Virtual Sketching Framework for Vector Line Art - SIGGRAPH 2021 Paper | Project Page Outline Dependencies Testing with Trained Weights Trainin

Haoran MO 118 Dec 27, 2022
Crowd-sourced Annotation of Human Motion.

Motion Annotation Tool Live: https://motion-annotation.humanoids.kit.edu Paper: The KIT Motion-Language Dataset Installation Start by installing all P

Matthias Plappert 4 May 25, 2020