BanditPAM: A state-of-the-art, high-performance k-medoids algorithm.
Project description
Quickstart
Run pip install banditpam and then check out the examples.
If you use this software, please cite: Mo Tiwari, Martin Jinye Zhang, James Mayclin, Sebastian Thrun, Chris Piech, Ilan Shomorony. “BanditPAM: Almost Linear Time k-medoids Clustering via Multi-Armed Bandits” Advances in Neural Information Processing Systems (NeurIPS) 2020.
Introduction
Clustering algorithms are ubiquitous in modern data science applications. Compared to the commonly used k-means clustering, k-medoids clustering requires the cluster centers to be actual datapoints and supports arbitrary dissimilarity functions in addition to standard distance metrics. This enables greater interpretability of the cluster centers and the clustering of structured objects. Despite these advantages, k-medoids clustering has been far less popular than k-means due to its computational cost. We present BanditPAM, a randomized algorithm inspired by techniques from multi-armed bandits, that scales almost linearly with dataset size and runs significantly faster than prior algorithms while still matching the best prior algorithms in clustering quality. Prior k-medoids algorithms such as PAM and FastPAM scale quadratically in the dataset size and are significantly slower than k-means, which scales linearly in dataset size. This algorithm, BanditPAM, almost matches k-means in complexity and is significantly faster than prior state-of-the-art with runtime O(nlogn).
Details
In this package, we provide a high-performance implementation of BanditPAM, a state-of-the-art k-medoids algorithm. BanditPAM:
matches the best prior work in clustering quality but scales as O(nlogn) instead of O(n^2) in each iteration, and
supports arbitrary dissimilarity functions between points – these functions need not even be proper metrics
This implementation is written in C++ for performance, but is callable from Python via Python bindings. The algorithm is empirically validated on several large, real-word datasets with a reduction in the number of distance evaluations of up to 200x while returning the same results as prior state-of-the-art.
Further Reading
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for banditpam-3.0.2a0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab4546804ef285e086f259db25845dfeb25913e308da00da5f098ff37dd2bd7 |
|
MD5 | 38e860582a80896dd5e3f705abb9b1b7 |
|
BLAKE2b-256 | 5544e524ae1e7fd9c8377adabdf97fb48d8a60c1f1994595b0b554ba6e4710d2 |
Hashes for banditpam-3.0.2a0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ec57a7bd6b9600559e3f38089759270760122f8608a6f8ab24bf33e2545b4dc |
|
MD5 | 1be31ef21e781e2357f6e70c49c9d5ff |
|
BLAKE2b-256 | 0a8b93e3ed03b6bfc69ac8b76e2645e5f64e691de04af113ef0e1c50830bd0bc |
Hashes for banditpam-3.0.2a0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26bf40774ad3bf7069b3463b32115a7f262807dcda4d0088389d0a1684fed386 |
|
MD5 | 3d37e09560f5b4e5e733dca39ecd9ee9 |
|
BLAKE2b-256 | 96ab89f0576c76283fc21aaeb759a5c46d5fd6a35d91927de5d2fe77124a6e3a |
Hashes for banditpam-3.0.2a0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b57e614402504f1431aadea2869ec83adf28deb5cfddced8a725db49ba0c9be |
|
MD5 | f82a09becf95837a1d44db70decd186a |
|
BLAKE2b-256 | 476e32517cf93ac7a9ac8027a16e873b32979fd763b146ac4f4e6e3125d64f20 |
Hashes for banditpam-3.0.2a0-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7fe0169a83d49e0596ce49f7762b4fefaab634414787eae49bec4b252310802 |
|
MD5 | 840a1e5d6de3d9dce12714467dc5cace |
|
BLAKE2b-256 | ec786bb01b832d90daa73f450b1face5dcd1df3ce7bf7c298503b3173219d068 |
Hashes for banditpam-3.0.2a0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8399fa9d67ef8b4a95fdc5b9421cfd38ce5ae711b4b9d636b6c4f0b445f4a233 |
|
MD5 | fe419b7dd9de9a18c89df43304a19bbe |
|
BLAKE2b-256 | 1ad6af498cc4a1eb71218ebce359f603b5e8e77840db0489bef28cebfa23377c |
Hashes for banditpam-3.0.2a0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caaf75fd3cf5c5f75e7112387df9b492c671507f499669958439d4d614ec8ca9 |
|
MD5 | 8f7a205666f11e49470465c523086842 |
|
BLAKE2b-256 | 80131d94744b9a345e61ffab01502a67826a0dd015a601e504933fb5d24b9710 |
Hashes for banditpam-3.0.2a0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 972e5241fb66ed64f14d42c349f860dc5bf90b6974a8576b258de59836fd9232 |
|
MD5 | 06d584fb477c3a0c113ba4dfc8e97116 |
|
BLAKE2b-256 | 46a82ec1605a01b8e7b219df7e96c121ae7e538b52a71798c265354fe234216b |
Hashes for banditpam-3.0.2a0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 822c09edb0c3494018725e01e86534f683f834ac1fd73e7cb6d658765bfd5b01 |
|
MD5 | 41440516ba5be4dfc34ae09acc7790d8 |
|
BLAKE2b-256 | 503c99275bcac9c18d82787b8cacde527231b4bdfc10533a8e9939e9debcc5b4 |
Hashes for banditpam-3.0.2a0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01a7f0b0e68723e3ef533557598960eead4b11354607455f3e9c988464c59849 |
|
MD5 | 0e6c58c252c66489bbbf4b99bdd8664e |
|
BLAKE2b-256 | dc0ac64bd980209df92441728a51060fac2e23478caab2ff9c5967f9c8b36ee5 |
Hashes for banditpam-3.0.2a0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8265b780e3feea3eac97ca9fc3391bc5d714906b34ef20d12e99c501cac4880f |
|
MD5 | 58ffa72cc89f2c5e2ffe907aa1dec675 |
|
BLAKE2b-256 | cf72369068d6f56bc2b41e72fbf015400ee8569049e8290fb11c83408af528de |
Hashes for banditpam-3.0.2a0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9800ee974fdde5ce346f8b4e607794bc971e6adbbddfe0abc5427e4a82e40c71 |
|
MD5 | 7175510fc83fd1eb4a46e0828dd78731 |
|
BLAKE2b-256 | 5487ea4453ac32a83a9a1fa94f8daa33e2b7d955e9aa3a46c2d8abd7d684d06f |
Hashes for banditpam-3.0.2a0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 324517671c6cf6b0f6a761d4db63aa6dbd1eb19fe1eb58f45ea3806c88eed72e |
|
MD5 | 56009170be8db4cc91a026f980ffb98e |
|
BLAKE2b-256 | 64647623d32d22f921979c94d6dfe143a7d7d7010fa18bb3cd5a0a2c0601bed4 |
Hashes for banditpam-3.0.2a0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cc3820651604f9388b5f58a737f82152c28618d66cfd44c30a095cb9ddd3da1 |
|
MD5 | ad4754bd6c23d40a87070628d1577139 |
|
BLAKE2b-256 | 01124aaf8cba6bb440d26647ded720c8f73a43d1bd14ff33c60a0d2f36fe0528 |
Hashes for banditpam-3.0.2a0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d2085da8a8cb8219577595eff3454dcb1097b308ec4d09a4f42eca7c5e928bb |
|
MD5 | c8952cc407fc68d4fd82bcf05ffaa7cc |
|
BLAKE2b-256 | a8d477b6c38bf71dac394be9abef24ff4b263240597a07806204b347c2e985cb |
Hashes for banditpam-3.0.2a0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34d2eaabab82b438057a9c243eba5a24ff8194578296bcd75608d5fce8582e27 |
|
MD5 | 7692eb1cf33f32a72189f1be75171292 |
|
BLAKE2b-256 | fa1b21a69afe8220c82894a9fb07dbb45e6de1507ab96a15d3ca257f0eecd8b1 |
Hashes for banditpam-3.0.2a0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8450737a8d68a81881c254b1b0dbbe19b4fc8284a619b58ec15ed4a012511ff2 |
|
MD5 | 9318760bee48a4c48dd48adb0a8495cc |
|
BLAKE2b-256 | 00e0fbf28320dc52b061be3b533cba448c56330e14aa21eee4c78e8d65d9e8e0 |
Hashes for banditpam-3.0.2a0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e050e7d084d148e6b9e27a53580264b4dd06e1a409655b8004ab1cdc680b54 |
|
MD5 | 4bc117c5d4c8991f0c1f428f4e71e870 |
|
BLAKE2b-256 | fd5237ec3e68b2c167e5c9cf590dbd94c090f52ba8c5ac88e596b711b855d034 |
Hashes for banditpam-3.0.2a0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11b3f764de14c59b1184c0e4abcb0b5379e1ba28d5accefbcda1e81a0ce53583 |
|
MD5 | 5f1ffcbb57669879a4bf5ac2d236ba63 |
|
BLAKE2b-256 | caf83adec3e114390299d79c60b8b15af9af9a57cdfe75fe1b8c4208b606e6eb |
Hashes for banditpam-3.0.2a0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f311dcced3c0adb9f7694e4f87f869d92f3da121d44142dbaa03287724ba7d |
|
MD5 | 061ae9e257f9da177e8d1beab4502d3e |
|
BLAKE2b-256 | 85d1aa03e5076e6c35b019a3fba655dce9c5a9e454cbccd3e65d0802a05fa96f |
Hashes for banditpam-3.0.2a0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 835bc52b57f3d3a62625d5f72babeaa704020d5ee020764d5c35e4f42203659d |
|
MD5 | 6e7329947c7303c21751e4d3a13c0f1a |
|
BLAKE2b-256 | ebd1e0c125a55bdf34832e934a09b0f5c26c86dc2b4dfe60435cd709f80e7481 |
Hashes for banditpam-3.0.2a0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2054bd05a278c35457b25122b09d969bf415cae0b61a30e91b11fa35884282b |
|
MD5 | 76f8e6478e40bf485237a1ef026bc392 |
|
BLAKE2b-256 | a44250c8aad20c0425d0f23d8e1b32c602b02f4a0c49970c5228d43e99a4ed24 |
Hashes for banditpam-3.0.2a0-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa14a090969e842d352a6e18bad99f90f936e530dd394ab98923273ac2c52e17 |
|
MD5 | 07271cea8a28b0d1a8f43ce6853e7067 |
|
BLAKE2b-256 | eadc2e0777a119d46e41a9c68dded60aceb8a1a6b9135db3b2e438fa49b77a38 |
Hashes for banditpam-3.0.2a0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92495d7ce65d1aaf1b44f8e9add7cb0a247fbf5e3ff5978ad1cd6b2323b88406 |
|
MD5 | c1d5afb0f64bf1abfb7b45bca6e511e8 |
|
BLAKE2b-256 | ea83d0a39dc625b9181c37accb5ac64ce3b8adf12f7275bc78dd678468123a13 |
Hashes for banditpam-3.0.2a0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eb4460091431b14b5f20e573b6de2b1fac5e609b6517ba06dd2e0672a199edb |
|
MD5 | db7f1b52214c8cc2f6de8ba528184264 |
|
BLAKE2b-256 | 4c028d55c00b733e5290b9d0360b614212d3f7bd5dad1ff7bf9531b7767bf31e |
Hashes for banditpam-3.0.2a0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a10d5508362ab3c29f60ef38ae21a95ebd7b950cffb70e1a509a10c059b20e1 |
|
MD5 | acc3a234f8361c1af4ce6e98772b9c8c |
|
BLAKE2b-256 | d9688ed7668a9b124483e2d3838555320c6c186b644d6212a9746c611846e44a |
Hashes for banditpam-3.0.2a0-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8846149fa528bd0e274208b70208c0393f78f863c02f0e7e77f957c534f9a653 |
|
MD5 | ed86ef9ac55722004132553ce5b9b07b |
|
BLAKE2b-256 | 676dece23e04df9218105c83a6d202b86b0b44295ca541cefa0f348320899d3c |
Hashes for banditpam-3.0.2a0-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0824ffb65c9627bbbfbb6b4f4ba4eb72041c7d846c8c9f42e7b12189209181f3 |
|
MD5 | f5f54ecd74421a8f072e76ac85415a4c |
|
BLAKE2b-256 | 5b6ab3392fe1f126f0cca78a614b8fc8cc922ebbaf87a82b7f598fc8ccda2311 |
Hashes for banditpam-3.0.2a0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a043f156983f51fcf122fa8ece5e259a33b9289e4d21d4c7cc679d5bb67feae0 |
|
MD5 | d43c577bf89e9977e4a8e65856aafb7f |
|
BLAKE2b-256 | f229462d813d01c715cd9d5737a4939bbbde92d3bc5c2c928caf3bb8c03860f1 |
Hashes for banditpam-3.0.2a0-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21799ac523a9b252bfecf5d1be890791ae0bd23771362f6d3e942065ff9a10cb |
|
MD5 | 7812ce076d09caa4b71753b93640e7c8 |
|
BLAKE2b-256 | 6530ec6814d5fe561849adee6cfeceda9988046c51983afeb0029307a4d93821 |
Hashes for banditpam-3.0.2a0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed73bdc58c67a822defa3ac298f67e0e2b4754ad8e11c176fc0a63959e814ab3 |
|
MD5 | 6bd4ef9f17e990f8b3f39ccab013bc56 |
|
BLAKE2b-256 | d8ad25ce310657614cc2ba22a7588b30014bcaa729304bad95762bc4ae6662e9 |