-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
33 lines (23 loc) · 1.42 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Federated Linear Contextual Bandits
This repository is the official implementation of Federated Linear Contextual Bandits.
Requirements
- Programming language: Python3,
- Packages Numpy 1.17.4, Scipy 1.3.2, Pandas 0.25.3.
Usage
To get a preliminary result, run this command:
- python3 main.py
It will plot the regret per client R(T) as function of T of four algorithms specified in the paper, i.e. Fed-PE, Local UCB, Enhanced Fed_PE, and Collaborative. The last algorithm is a modified version for full information exchange.
The feature vectors and arms parameters $\theta$ are generated in SyntheticProblem.py, which is a synthetic dataset.
To run the experiment on the MovieLens-100K, replace
- import SyntheticProblem as Construction
by
- import MovieLensProblem as Construction
in the file main.py. Then run the command:
- python3 main.py
It will plot the regret per client on the MovieLens-100K dataset.
Completing MovieLens-100K
The complete rating matrix is stored in complete_ratings.csv. The file can be get by running this command:
- python3 CollaborativeFilteringCopy.py
CollaborativeFilteringCopy.py is directly modified from a Github project: Collaborative-Filtering (https://github.com/kevalmorabia97/Collaborative-Filtering).
Optimization Problem
To solve multi-client G-optimal design or its equivalent Determinant Maximizaion subject to multi-constraints, use the function OptimalExperiment in minVar.py.