Official Python implementation for the work by Sarkar et al. on improved algorithms for Nash/p-mean regret minimisation in linear bandits. [arXiv]
FairLinBandit/
├── algorithms/ # Contains code for all bandit algorithms used
├── cached/ # Stores regret data from first-time runs
├── plots/ # Final figures
├── main.py # Master script: runs all experiments sequentially
├── experiments.py # Functions for running and plotting individual experiments
├── data_loader.py # Functions for loading datasets
└── requirements.txt # Python dependencies
Stores serialized regret data generated during the first run of each experiment which can be directly loaded for subsequent runs.
Holds the final plot images (e.g., .png files) for each experiment. These plots compare algorithmic performance under different settings.
-
Clone the repository:
git clone https://github.com/NP-Hardest/FairLinBandit.git cd FairLinBandit -
Create a conda environment (optional but recommended):
conda create -n FairLinBandit conda activate FairLinBandit
One can also use venv instead of conda.
-
Install dependencies:
pip install -r requirements.txt
Execute the master script to run all experiments in sequence. Use np.random.seed(42) for reproducing results from the paper:
python main.py
Adjust experiment parameters in main.py such as:
- Horizon length (T)
- Number of trials
- Algorithm-specific settings
- $p$ and $d$ values.
While running the experiments for the first time, the regret data is stored in cached/ directory. For subsequent runs, this data can be directly loaded using np.load().
-
After running the experiments, plots will be saved in the
plots/folder. -
Use the functions in
experiments.pyto customize plot styles or export formats.
Feel free to fork the repository to reproduce our results and other suggestions for modifications.