Skip to content

NP-Hardest/FairLinBandit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Improved Algorithms for Nash Welfare in Linear Bandits

Overview

Official Python implementation for the work by Sarkar et al. on improved algorithms for Nash/p-mean regret minimisation in linear bandits. [arXiv]

Repository Structure

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

cached/

Stores serialized regret data generated during the first run of each experiment which can be directly loaded for subsequent runs.

plots/

Holds the final plot images (e.g., .png files) for each experiment. These plots compare algorithmic performance under different settings.

Installation

  1. Clone the repository:

    git clone https://github.com/NP-Hardest/FairLinBandit.git
    cd FairLinBandit
    
  2. Create a conda environment (optional but recommended):

    conda create -n FairLinBandit 
    conda activate FairLinBandit
    

    One can also use venv instead of conda.

  3. Install dependencies:

    pip install -r requirements.txt
    

Usage

Run All Experiments

Execute the master script to run all experiments in sequence. Use np.random.seed(42) for reproducing results from the paper:

python main.py

Tweak Parameters

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().

Results & Visualization

  • After running the experiments, plots will be saved in the plots/ folder.

  • Use the functions in experiments.py to customize plot styles or export formats.

Contributing

Feel free to fork the repository to reproduce our results and other suggestions for modifications.

About

Official Repository of Improved Algorithms for Nash Welfare in Linear Bandits

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages