This repository is the official implementation of Generalized Linear Bandits with Local Differential Privacy by Yuxuan Han, Zhipeng Liang, Yang Wang, and Jiheng Zhang.
Requires python 3, numpy, matplotlib, etc. Please use the following command to install the dependencies:
pip install -r requirements.txt
If you use uv, install/sync the project dependencies with:
uv sync
We evaluate our algorithms in a real data CRPM-12-001: On-Line Auto Lending dataset, provided by the Center for Pricing and Revenue Management at Columbia University. To obtain a data set, please go to the website and follow their instructions
If you wish to use our repository in your work, please cite our paper:
BibTex:
@article{han2021generalized,
title={Generalized Linear Bandits with Local Differential Privacy},
author={Han, Yuxuan and Liang, Zhipeng and Wang, Yang and Zhang, Jiheng},
journal={Advances in Neural Information Processing Systems},
year={2021}
}
Any question about the scripts can be directed to the authors via email.
This project is licensed under the MIT License - see the LICENSE file for details
Self-contained Python scripts in this folder. Each can be run in two modes:
uv run <script>.py # display figures interactively
uv run <script>.py --save # save as PNG files| Script | Figure(s) | Description |
|---|---|---|
reproduce_frequent_update.py |
Figure 2 | Algorithm 1 (sparse update) vs Algorithm 5 (frequent update) under different privacy levels (epsilon = 0.1, 0.5, 1, +inf) |
reproduce_adv_context.py |
Figure 3 | Elliptical estimation error of the LDP OLS estimator under adversarial vs stochastic context sequences |
reproduce_diversity.py |
Figures 4 & 5 | Epoch greedy vs greedy vs greedy first, without strong diversity (Figure 4) and with strong diversity (Figure 5) |
'./Scheme1/' folder is for step size
'./Scheme2/' folder is for step size
Estimation error and cumulative regret comparisons of LDP-SGD, LDP-OLS, LDP-UCB and LDP-GLOC in the single-parameter setting.
For generating the figures in the paper please execute the following codes:
cd Scheme1
uv run instances/singleparam.py --eps 1 --dest "/results/single-param-eps=1/" > singleparam.out 2>&1 &
uv run instances/singleparam.py --eps 0.5 --dest "/results/single-param-eps=0.5/" > singleparam.out 2>&1 &
Cumulative regret comparisons of LDP-SGD, and LDP-GLOC in the single-parameter generalized linear reward setting.
cd Scheme1
uv run instances/logistic.py --eps 1 --dest "/results/logistic-eps=1/" > logistic.out 2>&1 &
uv run instances/logistic.py --eps 0.5 --dest "/results/logistic-eps=0.5/" > logistic.out 2>&1 &
uv run instances/poisson.py --eps 1 --dest "/results/poisson-eps=1/" > poisson.out 2>&1 &
uv run instances/poisson.py --eps 0.5 --dest "/results/poisson-eps=0.5/" > poisson.out 2>&1 &
cd Scheme1
uv run instances/multiparam.py --eps 1 --dest "/results/multi-param-eps=1/" > multiparam.out 2>&1 &
uv run instances/multiparam.py --eps 0.5 --dest "/results/multi-param-eps=0.5/" > multiparam.out 2>&1 &
Cumulative regret comparisons of LDP-SGD and LDP-GLOC on the CRPM-12-001 dataset.
cd Scheme1
uv run instances/crpm.py --eps 1 --dest "/results/crpm-eps=1/" > crpm.out 2>&1 &
uv run instances/crpm.py --eps 0.5 --dest "/results/crpm-eps=0.5/" > crpm.out 2>&1 &
To launch all Scheme1 runs listed above, execute:
cd Scheme1
sh run.sh