This repository provides the source code for the paper Bayesian Inference of Contextual Bandit Policies via Empirical Likelihood, published in JMLR.
examples/ – Notebooks demonstrating how to build and run inference models
experiments/ – Code for reproducing experiments in the paper
src/ctxbandit/ – Source code of the ctxbandit package
pyproject.toml – Package configuration and dependency specifications
Create a new environment and install the package locally:
mamba create -n ctxbandit python=3.12
mamba activate ctxbandit
git clone https://github.com/jr-ouyang/CtxBandit.git
cd CtxBandit
pip install .All dependencies are installed automatically as specified in pyproject.toml.
To get started, see the Jupyter notebooks in the examples/ directory.
These notebooks demonstrate how to construct inference models for a single policy, joint policies, and policy value differences.
The experiments/ directory contains experiments reported in the paper.
The workflow is managed using Snakemake 9.13.3 together with the Snakemake executor plugin for Slurm 1.8.0.
The rules and configurations for Slurm job submission are defined in the Snakefile.