This code repository includes the implementation and experiments for our federated bandit algorithms.

1. **MovieLens Preprocessing**

The file `movielens.ipynb` is used to preprocess the MovieLens dataset. It filters users who have rated all movie genres to meet the experimental requirements. The corresponding loss values are computed based on their ratings, as described in the experiment section of the main paper.

2. **Federated Bandits Code**

The folder `Federated Bandits/` contains two main files:
- `FederatedBanditAgent.py`: Implementation of the bandit algorithms and agents.
- `FederatedBanditEnvironment.py`: Implementation of the environment, including dataset integration.

3. **Running Experiments**

- **Synthetic Dataset**:  
  Run `Run Synthetic Datasets.py` to reproduce experiments on synthetic data.  
  Available topologies: `COMPLETE Graph`, `GRID Graph`, `RGG-0.5 Graph`.

- **MovieLens Dataset**:  
  Run `Run MovieLens Datasets.py` to reproduce experiments on the MovieLens dataset.  
  Available topologies: `COMPLETE Graph`, `GRID Graph`, `RGG-0.5 Graph`.
