Skip to content

amazon-science/ip-stability-for-clustering

Individual Preference Stability for Clustering

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:

  1. install all required packages as specified in environment.yml

  2. 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'

  3. 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.

Remarks

  • 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.

Citation

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)}
}

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages