This repository contains code for our ICML 2022 paper Individual Preference Stability for Clustering.
In order to reproduce the experiments of our paper, do the following:
-
install all required packages as specified in
environment.yml
-
in order to reproduce the experiments of Section 6.1 / Appendix G, set the parameters at the top of
experiments_general.py
and run the script; this will create a number of plots in the folder 'Results' -
in order to reproduce the experiments of Section 6.2 / Appendix H, set the parameters at the top of
experiments_1D.py
and run the script
If you want to run our dynamic programming approach of Section 5.1 / Appendix F for the 1-dimensional case on your own data, call the function DynamicProgramming_for_1Dimension_PInfinity(points,k,target_sizes) in functions.py
, where points is a sorted 1-dim Numpy-array containing the data, k is the number of clusters and target_sizes is a 1-dim Numpy-array of size k containing the target cluster sizes.
If you want to run our heuristic approach of Section 5 / Appendix G.3 that modifies linkage clustering on your own data, call the function linkage_clustering_with_greedy_pruning in functions.py
; see the docstring of that function for learning how to call it.
- We do not run the k-center algorithm and the group-fair k-center algorithm of Kleindessner et al. (2019a) when running experiments_general.py since we cannot provide their code here. If you want to run these algorithms, you should download their code from https://github.com/matthklein/fair_k_center_clustering and extend the scripts experiments_general.py and run_experiment_general.py accordingly.
If you publish material that uses this code, please cite our paper:
@inproceedings{ahmadi2022IPStability,
title={Individual Preference Stability for Clustering},
author={Ahmadi, Saba and Awasthi, Pranjal and Kleindessner, Matthäus and Khuller, Samir and Morgenstern, Jamie and Sukprasert, Pattara and Vakilian, Ali},
year={2022},
booktitle={International Conference on Machine Learning (ICML)}
}
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.