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.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8adad87cb614bc3c853b6949e9048dd86ef3d8876b059f98f3cbc2d9deb14b01 |
|
MD5 | a9daf9d98d0ec990a0f75fd2ca5b10ee |
|
BLAKE2b-256 | 0a176bed4c515d9aa3feb53b277a66a4b3047b2eb1a3953de1e21430bda05078 |
Hashes for banditpam-3.0.3-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaf5ea81651020c48946e78b070efa3a93444eedcb8b3fe0790a59a33512da01 |
|
MD5 | f98417a3697b46c02296d05ea877cb0a |
|
BLAKE2b-256 | e131c853fde398b5d3d83ed90266878dab3ddadcd03b4b43c9b9926ac3f92344 |
Hashes for banditpam-3.0.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77b93234cd12691b1ddee573a7ee0ae4af4c8e450da087d5f90e6131555ad556 |
|
MD5 | 040cb1d50f040eea1075c871b9dd84f5 |
|
BLAKE2b-256 | 15e8ae6ac0f22ed936295c9f80540bfaf3b9f66156afe087f961f598fa8a5905 |
Hashes for banditpam-3.0.3-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a263e16521eb5f6619218985e2aa15a78109832b2ed35e19426fd21ecd76264 |
|
MD5 | 7894f8628ddb68b128d5299a961972dc |
|
BLAKE2b-256 | 71603fc1c5a846a2b8bc067d54a05d31b868b4c0ece66997d8b2cade69f16cad |
Hashes for banditpam-3.0.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47b12f827fc6b74a91523b0cd62bb642bd312ec0bf6e9081b18048879b143377 |
|
MD5 | 7fa12acc19d3a4e519f59f357aaa543c |
|
BLAKE2b-256 | 9eb077665d0ef9efd78c7ea987dd39245619ba5ba0df094780dbef91983d8dd1 |
Hashes for banditpam-3.0.3-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0399c7c5d7ed35a39b020481d55f3afef334aa21c3cd10a2e1517a480fee2e6 |
|
MD5 | 42702f2135d685c2300ea15ae5fcdaab |
|
BLAKE2b-256 | e59777968a6550954484236c57e9666d66c2b9d160f6987e5d6379265c6909c5 |
Hashes for banditpam-3.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5085db6bba143567874e91acfb5146efd9949d0a3ae8a5b2bab966f46be850bc |
|
MD5 | 02df4a12900714d53cb8c4eb8266ca7a |
|
BLAKE2b-256 | 29ae063796208c02c0dec9917f98bf77dc3b02d222e021ff09cdaecbcacd1731 |
Hashes for banditpam-3.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 704354b9628ba8060295e5edb739ccaf5c4b8ccbc9d8801aca6dca47d2ae7ee5 |
|
MD5 | 2244e27c84a270722f787c6c29ffe78a |
|
BLAKE2b-256 | 4d6887c5a355dcbc333991be0af320055ebfc314c13f432715f3c10faa7e3aa5 |
Hashes for banditpam-3.0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5049a94c163b667b76f4b044cac1e6f087f87d70ede63e4790d3e1511bc38de5 |
|
MD5 | 10e8e2db1a2a6ffe8f0c80f104c6e9ea |
|
BLAKE2b-256 | ecfdb9ea41d1751b30221391871f76ed84fc0b758e1e0053703515598e53af49 |
Hashes for banditpam-3.0.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e95e34eaa39497cbbdbeb3d2a39a63d04f6a062e73cea9617da419a0764c63f |
|
MD5 | 0c07a046e98140b078d2e387886c7b70 |
|
BLAKE2b-256 | 6e4cb2b24f1d6ca0210f1cf2b679917713e0fe43ab6edd01b6d07db2e27bfec7 |
Hashes for banditpam-3.0.3-cp310-cp310-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65be353961c2dcc136e75265acefceeff8eaef6b4d140c4a0ff5969cd03e658e |
|
MD5 | afdd8aa54a7ed90fb84fa833a68ed5c8 |
|
BLAKE2b-256 | e93e2e5878ece097c1038499975c8a251b555f1ec73c71bd860a6d4ccc8f235c |
Hashes for banditpam-3.0.3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11aa1beef44e908b193c19e4e371d5d697f1fdd9c11b6b1cdc1b43e56a1bae1f |
|
MD5 | 952627eac1a6b89b9a02e36c7164282c |
|
BLAKE2b-256 | 0526b5fd992d94ef550d7b81dd72efd0330c559447bdda7b5d64e0987d7ad126 |
Hashes for banditpam-3.0.3-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e46c27d7dc830f83f9f2005c44cafd616ce45991c693c44652a92d1fa2173d |
|
MD5 | acbd596bf1e061606bb5b180ccb0ccce |
|
BLAKE2b-256 | 8687d522eaca8eb98ca444d014755291d42b500efe26f207a25c05fa15d16fb1 |
Hashes for banditpam-3.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d3b9bf94d78e6f798738391945b14e89a39456472a108fae2af9e16ac7aef1a |
|
MD5 | 3592b775fc94f5c6e1483f6ecaffea19 |
|
BLAKE2b-256 | 8de25b0e61d7d246b2c56136876992217a60ea974a88c4093969051d8edc18a7 |
Hashes for banditpam-3.0.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c479034ecd5c4430d430daf05a55bf0476d924039c90b6e88c1a8b33717c66ba |
|
MD5 | bdee39da044cf287960d7b6be93c0213 |
|
BLAKE2b-256 | 3dce662f6a478c89c66a5c576b50a9efec0e3422b940fb78e240b744d7afe190 |
Hashes for banditpam-3.0.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346552eb8d9dfdaf559023f32282d3d2392705880fbe69de0c48bea38aff3972 |
|
MD5 | 2337380f25dbb67f10cc7368e0df2ce5 |
|
BLAKE2b-256 | 39508f64ca5b60a446ffd8d5a962b1fd483f83090556326ebd93b0f061863ed5 |
Hashes for banditpam-3.0.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 757a2a7005d4a3585b1fac58a66fd674a73e173edf554f992e75a338caec11ff |
|
MD5 | 33ee5b7f0e6a403b856d7f9355fb5d43 |
|
BLAKE2b-256 | 086bc9797c765939d4ed8c1e03b86ef9260621a5b1824fd77001bab6109e0007 |
Hashes for banditpam-3.0.3-cp39-cp39-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cee6315d23210dbaf4ece0c1e83d346c9c1b88e47dea7342be63014708b846b2 |
|
MD5 | 92ca3ff7302f2ca4ccdba31110cd747b |
|
BLAKE2b-256 | ea71463ba622945e1fe83dd795f4f31aea442ab98de1484d4e700d9f75702230 |
Hashes for banditpam-3.0.3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f4ab97adffeb69c9fb0fd656276207567f592f770bdf98e7ead3025327cdae4 |
|
MD5 | 9f4aa53eb572e239ca733170d213f83e |
|
BLAKE2b-256 | 5f89c5172deed53b53c92b8d7d2c9fdc126123da0e0f714cec71cdd6a8a63ec0 |
Hashes for banditpam-3.0.3-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3595ac31884032fb2b766a76e5c9b4de8c2147eea1c2fdb31a39236b888f282 |
|
MD5 | a31ac0006163fcbdce0cf9fba0bf2929 |
|
BLAKE2b-256 | 4f27288692e0d7b20a4b5ecbb432c1fc38a40ea4257aa245384e9711b8cbcbee |
Hashes for banditpam-3.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36a8b069983ee726f9a25aefc15f74ecb8babf9ffa69a7f844b7a283ffd80aa |
|
MD5 | d6d8b5b1bfd1f506f1ac709a821519f5 |
|
BLAKE2b-256 | 2875833eb25741c5288fb4430080f8a27ef27081097f4cfb52aec02f26eae4cb |
Hashes for banditpam-3.0.3-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd2b6f37e41c6df9c75c6930c1dc42f285edd30c621c7936c676da9c3061204 |
|
MD5 | f62faf3a89c509be6f294e5c9e548214 |
|
BLAKE2b-256 | 550fb8019b491e73ca36264510f0ce35d9d0594c9a51913463aad7abaf01e96c |
Hashes for banditpam-3.0.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 593f0452147e0156237fa526f80aaca8e9362f4adba3cac1506dfd6450ba5a50 |
|
MD5 | b6a96b7abce3c338795a7ff2380debdb |
|
BLAKE2b-256 | cd465e2d37830c619d4f23e26bc7aad29659424b8783aca33462658388205b37 |
Hashes for banditpam-3.0.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 305dd9b2c9def13a3413c9136d48ae1ea97bfef52ffd13cfdf8c9a7762090d0a |
|
MD5 | c467b720cd5e2626a2776409f8ebbfd7 |
|
BLAKE2b-256 | 63314ec520d550f93a96441f6758e1ceb7382464cf85d5ae75d2c93d9b0feb13 |
Hashes for banditpam-3.0.3-cp38-cp38-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68d72a3d7197a172a5b425ed663781da1ffd114ea6e1ebb42c3ac941dd12bd4d |
|
MD5 | b4fa3386b034f1493d4310df64d1829b |
|
BLAKE2b-256 | 951367e547b8dbd163a874b7a087b16ce4e2dab4fcb074c63ed76b5cfaa80259 |
Hashes for banditpam-3.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae4b18e0ffd81b9e71c5e618edad93d86ba7d7255f2d8c104a7182644ec58712 |
|
MD5 | 7a684aa8b603424031cf73244433afdc |
|
BLAKE2b-256 | c3141770475186d2fd35a37bd9fac3f9bc94bbe3beedfc11be55afd144578706 |
Hashes for banditpam-3.0.3-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0057aece970ce01ab43d9ad11e966e0bc657988954cb7117f9e701470be85d4 |
|
MD5 | 0d793ff69878d7af3bbeeef7ab53e5b1 |
|
BLAKE2b-256 | 70ab12e20960db5e808058397c4c232960751e4cac8d30ab6caa073a094b70d1 |
Hashes for banditpam-3.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f717adc76860993f28cf8ac35a5789a78a3e449690c9bdea6f21131ed7843cf1 |
|
MD5 | f47a30db8ac22b035e3b40efdc966638 |
|
BLAKE2b-256 | 7bd4ec225c8e1f60f85997abdd39ddf9c0c26a5aa49d83408d32130b398d62dd |
Hashes for banditpam-3.0.3-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6c4331e52047ffdddf879b476803a0a8cba06b991a216215e5b226b5870fee1 |
|
MD5 | 46955c910fa283f57a60b2ebbde5280b |
|
BLAKE2b-256 | b39e501f3404397a35fd32f809d9533b58cb2e9dbc24a8878470198a228847c7 |
Hashes for banditpam-3.0.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8ed3d2def4b974c530f7ef18739ebdb1b899c15b7b4cab8aa4d71f623e21a77 |
|
MD5 | d94e66f94019e9b5cdd866ef490857b6 |
|
BLAKE2b-256 | 80b9bc6072513a0a1cba1a2aaf723cfc65ae6f6be76f85f2269a50ddc7a649b0 |
Hashes for banditpam-3.0.3-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ed8f4a2441c38d9c6d65ca1e1e915747b54fc586a943e2ede436a7506a87377 |
|
MD5 | 2544c0027132890387fd28597e216a92 |
|
BLAKE2b-256 | b6f61f26272504151b1fa2f9340f80f19c58f904346086130ba270bb3437e4aa |
Hashes for banditpam-3.0.3-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c24a198da913066630bdf1fa5c271e27976426af6c33eaddb39444d551e6e5c7 |
|
MD5 | f1daa0d2530ab82f97e7962fc3f14e43 |
|
BLAKE2b-256 | b1880d27d29d140d619278dc2681efdba95d8cc124186b6972b53447b3490108 |
Hashes for banditpam-3.0.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1754d84a9ecf56c1d2e016ca4c01bdc29703159d9b141a74a070b9a590113a9 |
|
MD5 | 9a4acf60043e5f080a090a834d2d7a10 |
|
BLAKE2b-256 | d329082873de274593b8038b4e011a0c6a23d88c52473afba39e1b536acdf9e9 |
Hashes for banditpam-3.0.3-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a01a11f2636db7456ac0003daa3317178a3314759f4fb7d4c9f96734f90b50a5 |
|
MD5 | 8a71df5859d45a806741af235ede45ad |
|
BLAKE2b-256 | b7a1dfb6562826f057ea2512df5c8bfdfde5ff64538f8905f08252f47ab84514 |
Hashes for banditpam-3.0.3-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3abffe45263e23d98bee387f1aab00aedbf88ea5840425ccbffe2043f1af1791 |
|
MD5 | 54accd85c0209cabdf5add0f3b647190 |
|
BLAKE2b-256 | b1812af4edc0a4575faaa31441e500c9fcd96eeb5b13944f292da4be8b19d1c2 |