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
You might also like...
Submodular Subset Selection for Active Domain Adaptation (ICCV 2021)
Submodular Subset Selection for Active Domain Adaptation (ICCV 2021)

S3VAADA: Submodular Subset Selection for Virtual Adversarial Active Domain Adaptation ICCV 2021 Harsh Rangwani, Arihant Jain*, Sumukh K Aithal*, R. Ve

QuickAI is a Python library that makes it extremely easy to experiment with state-of-the-art Machine Learning models.
QuickAI is a Python library that makes it extremely easy to experiment with state-of-the-art Machine Learning models.

QuickAI is a Python library that makes it extremely easy to experiment with state-of-the-art Machine Learning models.

Experiment about Deep Person Re-identification with EfficientNet-v2
Experiment about Deep Person Re-identification with EfficientNet-v2

We evaluated the baseline with Resnet50 and Efficienet-v2 without using pretrained models. Also Resnet50-IBN-A and Efficientnet-v2 using pretrained on ImageNet. We used two datasets: Market-1501 and CUHK03.

Calling Julia from Python - an experiment on data loading

Calling Julia from Python - an experiment on data loading See the slides. TLDR After reading Patrick's blog post, we decided to try to replace C++ wit

An experiment to bait a generalized frontrunning MEV bot

Honeypot 🍯 A simple experiment that: Creates a honeypot contract Baits a generalized fronturnning bot with a unique transaction Analyze bot behaviour

A practical ML pipeline for data labeling with experiment tracking using DVC.

Auto Label Pipeline A practical ML pipeline for data labeling with experiment tracking using DVC Goals: Demonstrate reproducible ML Use DVC to build a

Small-bets - Ergodic Experiment With Python

Ergodic Experiment Based on this video. Run this experiment with this command: p

An experiment on the performance of homemade Q-learning AIs in Agar.io depending on their state representation and available actions
An experiment on the performance of homemade Q-learning AIs in Agar.io depending on their state representation and available actions

Agar.io_Q-Learning_AI An experiment on the performance of homemade Q-learning AIs in Agar.io depending on their state representation and available act

POT : Python Optimal Transport

POT: Python Optimal Transport This open source Python library provide several solvers for optimization problems related to Optimal Transport for signa

Owner
null
PyTorch Implementation for AAAI'21 "Do Response Selection Models Really Know What's Next? Utterance Manipulation Strategies for Multi-turn Response Selection"

UMS for Multi-turn Response Selection Implements the model described in the following paper Do Response Selection Models Really Know What's Next? Utte

Taesun Whang 47 Nov 22, 2022
Implementation of "Selection via Proxy: Efficient Data Selection for Deep Learning" from ICLR 2020.

Selection via Proxy: Efficient Data Selection for Deep Learning This repository contains a refactored implementation of "Selection via Proxy: Efficien

Stanford Future Data Systems 70 Nov 16, 2022
Code for the KDD 2021 paper 'Filtration Curves for Graph Representation'

Filtration Curves for Graph Representation This repository provides the code from the KDD'21 paper Filtration Curves for Graph Representation. Depende

Machine Learning and Computational Biology Lab 16 Oct 16, 2022
Code for: Gradient-based Hierarchical Clustering using Continuous Representations of Trees in Hyperbolic Space. Nicholas Monath, Manzil Zaheer, Daniel Silva, Andrew McCallum, Amr Ahmed. KDD 2019.

gHHC Code for: Gradient-based Hierarchical Clustering using Continuous Representations of Trees in Hyperbolic Space. Nicholas Monath, Manzil Zaheer, D

Nicholas Monath 35 Nov 16, 2022
This project provides an unsupervised framework for mining and tagging quality phrases on text corpora with pretrained language models (KDD'21).

UCPhrase: Unsupervised Context-aware Quality Phrase Tagging To appear on KDD'21...[pdf] This project provides an unsupervised framework for mining and

Xiaotao Gu 146 Dec 22, 2022
Code for KDD'20 "An Efficient Neighborhood-based Interaction Model for Recommendation on Heterogeneous Graph"

Heterogeneous INteract and aggreGatE (GraphHINGE) This is a pytorch implementation of GraphHINGE model. This is the experiment code in the following w

Jinjiarui 69 Nov 24, 2022
A PyTorch implementation of "Cluster-GCN: An Efficient Algorithm for Training Deep and Large Graph Convolutional Networks" (KDD 2019).

ClusterGCN ⠀⠀ A PyTorch implementation of "Cluster-GCN: An Efficient Algorithm for Training Deep and Large Graph Convolutional Networks" (KDD 2019). A

Benedek Rozemberczki 697 Dec 27, 2022
A PyTorch implementation of "Graph Classification Using Structural Attention" (KDD 2018).

GAM ⠀⠀ A PyTorch implementation of Graph Classification Using Structural Attention (KDD 2018). Abstract Graph classification is a problem with practic

Benedek Rozemberczki 259 Dec 5, 2022
The official implementation of NeurIPS 2021 paper: Finding Optimal Tangent Points for Reducing Distortions of Hard-label Attacks

The official implementation of NeurIPS 2021 paper: Finding Optimal Tangent Points for Reducing Distortions of Hard-label Attacks

machen 11 Nov 27, 2022
This is the official code of our paper "Diversity-based Trajectory and Goal Selection with Hindsight Experience Relay" (PRICAI 2021)

Diversity-based Trajectory and Goal Selection with Hindsight Experience Replay This is the official implementation of our paper "Diversity-based Traje

Tianhong Dai 6 Jul 18, 2022