# Supplementary Materials - ICLR Submission

This document provides detailed instructions for running the simulation code and reproducing the experimental results presented in the paper. Our code requires the Torch and Botorch frameworks in Python 3.8.5. You may need to configure your environment; see **requirements.txt** for details. The noise injected in the code is a Gaussian mechanism, but our algorithm can adapt to any noise mechanism and you can change it to suit your requirements. Specific privacy parameters are marked in the code.

---

## 📦 SWC.ipynb

**Description:**  
This Jupyter notebook script implements the compression of the sliced ​​Wasserstein distance of Algorithm 2.

**Instructions:**  
- Ensure that the required Python libraries are installed ('torch', 'numpy'). 
- Adjusting the sample size for Monte Carlo approximation.

---

## 📦 LDP-BO.ipynb

**Description:**  
This Jupyter notebook implements the Bayesian optimization for online privacy protection described in Algorithm 1.

**Instructions:**  
- Ensure that the required Python libraries are installed (`gpytorch`, `botorch`, etc). For specific versions, please refer to **requirements.txt**.
- The description of each function has been annotated in Jupyter.

---

## 🐍 example1.ipynb

**Description:**  
This code implements the simulation of the linear model in Example 1 in the paper.

**Instructions:**  
- Make sure that both SWC.ipynb and LDP-BO.ipynb are imported successfully. 
- Modify the number of cores on your computer for parallel.
- Execute the notebook to reproduce the results in the paper.
- Each parameter can be adjusted as needed, and the parameter name has been noted in the code.
- You may also alter the data generation method to evaluate other model, such as  logisti and ReLU.

---

# 🐍 example2.ipynb

**Description:**  
This code implements the simulation of the Sine function in Example 2 in the paper.

**Instructions:**  
- Make sure that both SWC.ipynb and LDP-BO.ipynb are imported successfully. 
- Modify the number of cores on your computer for parallel.
- Execute the notebook to reproduce the results in the paper.
- We optimize the logarithm of the parameters to ensure that the definition is over the entire real number domain.
- You may also alter the data generation method to evaluate other model, such as  Friedman function.

---

# 🐍 readata.ipynb

**Description:**  
This code reproduces the real data experiment using the **Uber.csv** dataset.

**Instructions:**  
- Make sure that both SWC.ipynb and LDP-BO.ipynb are imported successfully. 
- Ensure that the required Python libraries are installed (`numpy`, `pandas`, `seaborn`, `datetime`, `geopy.distance`, 'sklearn.preprocessing') for data preprocessing.
- Modify the number of cores on your computer for parallel.
- Modify the file import path according to your own situation.

---

## ✅ Notes:
- Adjust the privacy parameters and compression budget of the model or algorithm.
- Although we added Gaussian noise, you can replace it with any noise mechanism.
- Ensure that all necessary libraries are installed before running  notebook.
- Modify file paths as needed to align with your local environment.

For further details, please refer to the appendix or address them during the rebuttal phase.
