Re:Show HN: Want something better than k-means? Try BanditPAM
by mnky9800n on Wednesday March 29, 2023 @04:27PM
(#35363008)
Not to be flippant but isn't everything better then k means?
Re:Show HN: Want something better than k-means? Try BanditPAM
by motiwari on Wednesday March 29, 2023 @04:31PM
(#35363078)
Sorry, I don't understand your argument. Could you clarify what you mean by "everything"? Is there another clustering algorithm you're thinking of?
Re:Show HN: Want something better than k-means? Try BanditPAM
by mnky9800n on Friday March 31, 2023 @06:07AM
(#35384779)
i just mean that k-means is a rather simple algorithm for finding centroids. most algorithms that are more sophisticated might do better than k-means.
Re:Show HN: Want something better than k-means? Try BanditPAM
by motiwari on Monday April 03, 2023 @06:01PM
(#35431917)
Sorry for the late response. And actually, despite the plethora of clustering algorithms, k-means is still a very commonly-used out-of-the-box technique! (Probably for its simplicity and existing popularity)
Unlike in k-means, the k-medoids problem requires cluster centers to be actual datapoints, which permits greater interpretability of your cluster centers. k-medoids also works better with arbitrary distance metrics, so your clustering can be more robust to outliers if you're using metrics like L1.
Despite these advantages, most people don't use k-medoids because prior algorithms were too slow. In our NeurIPS 2020 paper, BanditPAM, we sped up the best known algorithm from O(n^2) to O(nlogn).
We've released our implementation, which is pip- and CRAN-installable. It's written in C++ for speed, but callable from Python and R. It also supports parallelization and intelligent caching at no extra complexity to end users. Its interface also matches the sklearn.cluster.KMeans interface, so minimal changes are necessary to existing code.
Our previous announcement that went viral: https://www.linkedin.com/posts/motiwari_want-something-bette...
PyPI: https://pypi.org/project/banditpam
CRAN: https://cran.r-project.org/web/packages/banditpam/index.html
Repo: https://github.com/motiwari/BanditPAM
Paper: https://arxiv.org/abs/2006.06856
If you find our work valuable, please consider starring the repo or citing our work. These help us continue development on this project.
I'm Mo Tiwari (https://motiwari.com), a PhD student in Computer Science at Stanford University. A special thanks to my collaborators on this project, Martin Jinye Zhang, James Mayclin, Sebastian Thrun, Chris Piech, and Ilan Shomorony, as well as the author of the R package, Balasubramanian Narasimhan.
(This is my first time posting on HN; I've read the FAQ before posting, but please let me know if I broke any rules)