Title: Want something better than k-means? I&#x27;m happy to announce our SOTA k-medoids algorithm from NeurIPS 2020, BanditPAM, is now publicly available! `pip install banditpam` or `install.packages(&quot;banditpam&quot;)` and you&#x27;re good to go!<p>k-means is one of the most widely-used algorithms to cluster data. However, it has several limitations: a) it requires the use of L2 distance for efficient clustering, which also b) restricts the data you&#x27;re clustering to be vectors, and c) doesn&#x27;t require the means to be datapoints in the dataset.<p>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&#x27;re using metrics like L1. Despite these advantages, most people don&#x27;t use k-medoids because prior algorithms were too slow.<p>In our NeurIPS 2020 paper, BanditPAM, we sped up the best known algorithm from O(n^2) to O(nlogn) by using techniques from multi-armed bandits. We were inspired by prior research that demonstrated many algorithms can be sped up by sampling the data intelligently, instead of performing exhaustive computations.<p>We&#x27;ve released our implementation, which is pip- and CRAN-installable. It&#x27;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.<p>PyPI: <a href="https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;banditpam" rel="nofollow">https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;banditpam</a><p>CRAN: <a href="https:&#x2F;&#x2F;cran.r-project.org&#x2F;web&#x2F;packages&#x2F;banditpam&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;cran.r-project.org&#x2F;web&#x2F;packages&#x2F;banditpam&#x2F;index.html</a><p>Repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;motiwari&#x2F;BanditPAM">https:&#x2F;&#x2F;github.com&#x2F;motiwari&#x2F;BanditPAM</a><p>Paper: <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2006.06856" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2006.06856</a><p>If you find our work valuable, please consider starring the repo or citing our work. These help us continue development on this project.<p>I&#x27;m Mo Tiwari (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.<p>(This is my first time posting on HN; I&#x27;ve read the FAQ before posting, but please let me know if I broke any rules)
Upvote: