Towards the D-Optimal Online Experiment Design for Recommender Selection (KDD 2021)

Overview

Towards the D-Optimal Online Experiment Design for Recommender Selection (KDD 2021)

Contact [email protected] or [email protected] for questions.

Running code

Install packages

pip install -r requirements.txt 

Recommender

We use the recommenders implemented under our project for adversarial counterfactual learning published in NIPS 2020.

  • Step 1: clone the project to your local directory.

  • Step 2: pip install . to install the library.

Item features

The data ml-1m.zip is under the data folder. We need to generate the movies and users features before running the simulations.

cd data & unzip ml-1m.zip
cd ml-1m
python base_embed.py # This generates base movie and user features vector

Simulation

Assume you are in the project's main folder:

python run.py #This will runs all defined simulation routines defined in simulation.py

Optional argument:

usage: System Bandit Simulation [-h] [--dim DIM] [--topk TOPK] [--num_epochs NUM_EPOCHS] [--epsilon EPSILON] [--explore_step EXPLORE_STEP] [--feat_map {onehot,context,armed_context,onehot_context}]
                                [--algo {base,e_greedy,thomson,lin_ct,optimal}]

optional arguments:
  -h, --help            show this help message and exit
  --dim DIM
  --topk TOPK
  --num_epochs NUM_EPOCHS
  --epsilon EPSILON
  --explore_step EXPLORE_STEP
  --feat_map {onehot,context,armed_context,onehot_context}
  --algo {base,e_greedy,thomson,lin_ct,optimal}

Major class

Environment

This class implement the simulation logics described in our paper. For each user, we runs the get_epoch method, which returns an refreshed simulator based on the last interaction with the user.

Example:

float: """Return the reward given selected arm and the recommendations""" pass # Example usage BanditData = List[Tuple[int, float, Any]] data: BanditData = [] for uidx, recall_set in env.get_epoch(): arm = algo.predict() recommendations = bandit_ins.get_arm(arm).recommend(uidx, recall_set, top_k) reward = env.action(uidx, recommendations) data.append((arm, reward, None)) algo.update(data) algo.record_metric(data) ">
class Environment:
    def get_epoch(self, shuffle: bool = True):
        """Return updated environment iterator"""
        return EpochIter(self, shuffle)

    def action(self, uidx: int, recommendations: List[int]) -> float:
        """Return the reward given selected arm and the recommendations"""
        pass

# Example usage
BanditData = List[Tuple[int, float, Any]]
data: BanditData = []
for uidx, recall_set in env.get_epoch():
    arm = algo.predict()
    recommendations = bandit_ins.get_arm(arm).recommend(uidx, recall_set, top_k)
    reward = env.action(uidx, recommendations)
    data.append((arm, reward, None))
algo.update(data)
algo.record_metric(data) 

BanditAlgorithm

The BanditALgorithm implement the interfaces for any bandit algorithms evaluated in this project.

class BanditAlgorithm:
    def predict(self, *args, **kwds) -> int:
        """Return the estimated return for contextual bandit"""
        pass

    def update(self, data: BanditData):
        """Update the algorithms based on observed (action, reward, context)"""
        pass

    def record_metric(self, data: BanditData):
        """Record the cumulative performance metrics for this algorithm"""
        pass
nfelo: a power ranking, prediction, and betting model for the NFL

nfelo nfelo is a power ranking, prediction, and betting model for the NFL. Nfelo take's 538's Elo framework and further adapts it for the NFL, hence t

6 Nov 22, 2022
A disassembler for the RP2040 Programmable I/O State-machine!

piodisasm A disassembler for the RP2040 Programmable I/O State-machine! Usage Just run piodisasm.py on a file that contains the PIO code as hex! (Such

Ghidra Ninja 29 Dec 06, 2022
Py4fi2nd - Jupyter Notebooks and code for Python for Finance (2nd ed., O'Reilly) by Yves Hilpisch.

Python for Finance (2nd ed., O'Reilly) This repository provides all Python codes and Jupyter Notebooks of the book Python for Finance -- Mastering Dat

Yves Hilpisch 1k Jan 05, 2023
Code for "LoFTR: Detector-Free Local Feature Matching with Transformers", CVPR 2021

LoFTR: Detector-Free Local Feature Matching with Transformers Project Page | Paper LoFTR: Detector-Free Local Feature Matching with Transformers Jiami

ZJU3DV 1.4k Jan 04, 2023
Code for generating the figures in the paper "Capacity of Group-invariant Linear Readouts from Equivariant Representations: How Many Objects can be Linearly Classified Under All Possible Views?"

Code for running simulations for the paper "Capacity of Group-invariant Linear Readouts from Equivariant Representations: How Many Objects can be Lin

Matthew Farrell 1 Nov 22, 2022
Single cell current best practices tutorial case study for the paper:Luecken and Theis, "Current best practices in single-cell RNA-seq analysis: a tutorial"

Scripts for "Current best-practices in single-cell RNA-seq: a tutorial" This repository is complementary to the publication: M.D. Luecken, F.J. Theis,

Theis Lab 968 Dec 28, 2022
[ACM MM 2021] Yes, "Attention is All You Need", for Exemplar based Colorization

Transformer for Image Colorization This is an implemention for Yes, "Attention Is All You Need", for Exemplar based Colorization, and the current soft

Wang Yin 30 Dec 07, 2022
BABEL: Bodies, Action and Behavior with English Labels [CVPR 2021]

BABEL is a large dataset with language labels describing the actions being performed in mocap sequences. BABEL labels about 43 hours of mocap sequences from AMASS [1] with action labels.

113 Dec 28, 2022
This repository contains code for the paper "Disentangling Label Distribution for Long-tailed Visual Recognition", published at CVPR' 2021

Disentangling Label Distribution for Long-tailed Visual Recognition (CVPR 2021) Arxiv link Blog post This codebase is built on Causal Norm. Install co

Hyperconnect 85 Oct 18, 2022
Code for paper "Vocabulary Learning via Optimal Transport for Neural Machine Translation"

**Codebase and data are uploaded in progress. ** VOLT(-py) is a vocabulary learning codebase that allows researchers and developers to automaticaly ge

416 Jan 09, 2023
Python Implementation of Chess Playing AI with variable difficulty

Chess AI with variable difficulty level implemented using the MiniMax AB-Pruning Algorithm

Ali Imran 7 Feb 20, 2022
LLVM-based compiler for LightGBM gradient-boosted trees. Speeds up prediction by ≥10x.

LLVM-based compiler for LightGBM gradient-boosted trees. Speeds up prediction by ≥10x.

Simon Boehm 183 Jan 02, 2023
Efficient and Accurate Arbitrary-Shaped Text Detection with Pixel Aggregation Network

Efficient and Accurate Arbitrary-Shaped Text Detection with Pixel Aggregation Network Paddle-PANet 目录 结果对比 论文介绍 快速安装 结果对比 CTW1500 Method Backbone Fine

7 Aug 08, 2022
OpenDILab RL Kubernetes Custom Resource and Operator Lib

DI Orchestrator DI Orchestrator is designed to manage DI (Decision Intelligence) jobs using Kubernetes Custom Resource and Operator. Prerequisites A w

OpenDILab 205 Dec 29, 2022
[ECCV 2020] XingGAN for Person Image Generation

Contents XingGAN or CrossingGAN Installation Dataset Preparation Generating Images Using Pretrained Model Train and Test New Models Evaluation Acknowl

Hao Tang 218 Oct 29, 2022
"Segmenter: Transformer for Semantic Segmentation" reproduced via mmsegmentation

Segmenter-based-on-OpenMMLab "Segmenter: Transformer for Semantic Segmentation, arxiv 2105.05633." reproduced via mmsegmentation. We reproduce Segment

EricKani 22 Feb 24, 2022
Get the partition that a file belongs and the percentage of space that consumes

tinos_eisai_sy Get the partition that a file belongs and the percentage of space that consumes (works only with OSes that use the df command) tinos_ei

Konstantinos Patronas 6 Jan 24, 2022
PConv-Keras - Unofficial implementation of "Image Inpainting for Irregular Holes Using Partial Convolutions". Try at: www.fixmyphoto.ai

Partial Convolutions for Image Inpainting using Keras Keras implementation of "Image Inpainting for Irregular Holes Using Partial Convolutions", https

Mathias Gruber 871 Jan 05, 2023
A transformer which can randomly augment VOC format dataset (both image and bbox) online.

VocAug It is difficult to find a script which can augment VOC-format dataset, especially the bbox. Or find a script needs complex requirements so it i

Coder.AN 1 Mar 05, 2022
JFB: Jacobian-Free Backpropagation for Implicit Models

JFB: Jacobian-Free Backpropagation for Implicit Models

Typal Research 28 Dec 11, 2022