File size: 2,434 Bytes
e89a301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# FairHash: A Fair and Memory/Time-efficient Hashmap

### Companion repository for the paper "FairHash: A Fair and Memory/Time-efficient Hashmap". 



## Publication(s) to cite:
Nima Shahbazi, Stavros Sintos, and Abolfazl Asudeh. "FairHash: A Fair and Memory/Time-efficient Hashmap." Proceedings of the ACM on Management of Data 2.3 (2024): 1-29.



## Installation
- Clone the repo
- Create a virtual environment using e.g., venv or Conda
- Install any missing packages using e.g., pip or Conda
  - main packages are fairly standard (e.g., Pandas, NumPy, Matplotlib)

## Usage
The algorithms are implemented in `[algorithm-name].py`. You can familiarize yourself with the code by looking at the `[algorithm-name]_test.py`. Each algorithm accepts the following inputs:
- Dataset
- Sensitive attribute (categorical)
- Non-sensitive attributes (ordinal real-valued)
- Number of buckets

The algorithm returns a sorted list of boundaries that specify the boundaries for each hash bucket.

### Data for reproducing the results:
- The data used in our experiments can be downloaded from here: [Link](https://drive.google.com/file/d/1WkFX1imNOPXWcHi4L2VPmVW_aYVdYGwL/view?usp=sharing) 

### Reproducing the results:
- Unzip the data folder in the root directory of the project
- The following Python files will reproduce the experiments for each algorithm:
  - Necklace Splitting algorithm results: `python necklace_split_binary_test.py`
  - Sweep & Cut algorithm results: `python sweep_and_cut_test.py`
  - Sampled Ranking algorithm results: `python ranking_sampled_vector_test.py`
  - Ranking (ray sweeping) algorithm results: `python ranking_2d_test.py`
  - Local Search heuristic results: `python local_search.py`
- Testing FairHash on held-out data: `python train_test.py`

## Notice
This project is still under development, so please beware of potential bugs, issues, etc. Use at your own responsibility in practice.

## Contact
Feel free to contact the authors or leave an issue in case of any complications. We will try to respond as soon as possible.
- Nima Shahbazi: https://neemashahbazi.github.io/
- A. Asudeh: https://www.cs.uic.edu/~asudeh/
- S. Sintos: https://sites.google.com/view/stavros-sintos

## License

This project is licensed under the MIT License — see the [LICENSE.md](LICENSE.md) file for details.

<!---<p align="center"><img width="20%" src="https://www.cs.uic.edu/~indexlab/imgs/InDeXLab2.gif"></p>-->