{"id":32955139,"url":"https://github.com/lmcinnes/hdbscan","last_synced_at":"2026-01-14T10:18:07.359Z","repository":{"id":60721097,"uuid":"67036347","full_name":"lmcinnes/hdbscan","owner":"lmcinnes","description":"A high performance implementation of HDBSCAN clustering. http://hdbscan.readthedocs.io/en/latest/","archived":false,"fork":true,"pushed_at":"2017-11-09T03:22:00.000Z","size":24024,"stargazers_count":101,"open_issues_count":0,"forks_count":26,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-12-23T10:13:17.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"scikit-learn-contrib/hdbscan","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmcinnes.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-31T12:42:29.000Z","updated_at":"2025-12-09T07:02:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lmcinnes/hdbscan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lmcinnes/hdbscan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fhdbscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fhdbscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fhdbscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fhdbscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmcinnes","download_url":"https://codeload.github.com/lmcinnes/hdbscan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmcinnes%2Fhdbscan/sbom","scorecard":{"id":596076,"data":{"date":"2025-08-11","repo":{"name":"github.com/lmcinnes/hdbscan","commit":"c3c259ea7c849a53339a0bf8fb12bd1fb5a68cc0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: downloadThenRun not pinned by hash: ci_scripts/install.sh:19","Warn: pipCommand not pinned by hash: ci_scripts/install.sh:34","Info:   0 out of   1 pipCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2021-854 / GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: PYSEC-2021-855 / GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2020-107 / GHSA-jjw5-xxj6-pcv5","Warn: Project is vulnerable to: PYSEC-2024-110 / GHSA-jw8x-6495-233v","Warn: Project is vulnerable to: PYSEC-2020-108","Warn: Project is vulnerable to: PYSEC-2019-156 / GHSA-xp76-357g-9wqq","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T23:10:32.518Z","repository_id":60721097,"created_at":"2025-08-20T23:10:32.518Z","updated_at":"2025-08-20T23:10:32.518Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-12T22:00:41.101Z","updated_at":"2026-01-14T10:18:07.354Z","avatar_url":"https://github.com/lmcinnes.png","language":"Jupyter Notebook","funding_links":[],"categories":["Python"],"sub_categories":["General-Purpose Machine Learning"],"readme":".. image:: https://img.shields.io/pypi/v/hdbscan.svg\n    :target: https://pypi.python.org/pypi/hdbscan/\n    :alt: PyPI Version\n.. image:: https://anaconda.org/conda-forge/hdbscan/badges/version.svg\n    :target: https://anaconda.org/conda-forge/hdbscan\n    :alt: Conda-forge Version\n.. image:: https://anaconda.org/conda-forge/hdbscan/badges/downloads.svg\n    :target: https://anaconda.org/conda-forge/hdbscan\n    :alt: Conda-forge downloads\n.. image:: https://img.shields.io/pypi/l/hdbscan.svg\n    :target: https://github.com/scikit-learn-contrib/hdbscan/blob/master/LICENSE\n    :alt: License\n.. image:: https://travis-ci.org/scikit-learn-contrib/hdbscan.svg\n    :target: https://travis-ci.org/scikit-learn-contrib/hdbscan\n    :alt: Travis Build Status\n.. image:: https://coveralls.io/repos/github/scikit-learn-contrib/hdbscan/badge.svg?branch=master\n    :target: https://coveralls.io/github/scikit-learn-contrib/hdbscan?branch=master\n    :alt: Test Coverage\n.. image:: https://readthedocs.org/projects/hdbscan/badge/?version=latest\n    :target: https://hdbscan.readthedocs.org\n    :alt: Docs\n.. image:: http://joss.theoj.org/papers/10.21105/joss.00205/status.svg\n    :target: http://joss.theoj.org/papers/10.21105/joss.00205\n    :alt: JOSS article\n\n=======\nHDBSCAN\n=======\n\n-----------------------------------\nNow a part of `scikit-learn-contrib \u003chttps://github.com/scikit-learn-contrib/hdbscan\u003e`_ \n-----------------------------------\n\nHDBSCAN - Hierarchical Density-Based Spatial Clustering of Applications\nwith Noise. Performs DBSCAN over varying epsilon values and integrates \nthe result to find a clustering that gives the best stability over epsilon.\nThis allows HDBSCAN to find clusters of varying densities (unlike DBSCAN),\nand be more robust to parameter selection.\n\nIn practice this means that HDBSCAN returns a good clustering straight\naway with little or no parameter tuning -- and the primary parameter,\nminimum cluster size, is intuitive and easy to select.\n\nHDBSCAN is ideal for exploratory data analysis; it's a fast and robust\nalgorithm that you can trust to return meaningful clusters (if there\nare any).\n\nBased on the paper:\n    R. Campello, D. Moulavi, and J. Sander, *Density-Based Clustering Based on\n    Hierarchical Density Estimates*\n    In: Advances in Knowledge Discovery and Data Mining, Springer, pp 160-172.\n    2013\n    \nDocumentation, including tutorials, are available on ReadTheDocs at http://hdbscan.readthedocs.io/en/latest/ .  \n    \nNotebooks `comparing HDBSCAN to other clustering algorithms \u003chttp://nbviewer.jupyter.org/github/scikit-learn-contrib/hdbscan/blob/master/notebooks/Comparing%20Clustering%20Algorithms.ipynb\u003e`_, explaining `how HDBSCAN works \u003chttp://nbviewer.jupyter.org/github/scikit-learn-contrib/hdbscan/blob/master/notebooks/How%20HDBSCAN%20Works.ipynb\u003e`_ and `comparing performance with other python clustering implementations \u003chttp://nbviewer.jupyter.org/github/scikit-learn-contrib/hdbscan/blob/master/notebooks/Benchmarking%20scalability%20of%20clustering%20implementations-v0.7.ipynb\u003e`_ are available.\n\n------------------\nHow to use HDBSCAN\n------------------\n\nThe hdbscan package inherits from sklearn classes, and thus drops in neatly\nnext to other sklearn clusterers with an identical calling API. Similarly it\nsupports input in a variety of formats: an array (or pandas dataframe, or\nsparse matrix) of shape ``(num_samples x num_features)``; an array (or sparse matrix)\ngiving a distance matrix between samples.\n\n.. code:: python\n\n    import hdbscan\n    from sklearn.datasets import make_blobs\n    \n    data, _ = make_blobs(1000)\n    \n    clusterer = hdbscan.HDBSCAN(min_cluster_size=10)\n    cluster_labels = clusterer.fit_predict(data)\n\n-----------\nPerformance\n-----------\n\nSignificant effort has been put into making the hdbscan implementation as fast as \npossible. It is `orders of magnitude faster than the reference implementation \u003chttp://nbviewer.jupyter.org/github/scikit-learn-contrib/hdbscan/blob/master/notebooks/Python%20vs%20Java.ipynb\u003e`_ in Java,\nand is currently faster than highly optimized single linkage implementations in C and C++.\n`version 0.7 performance can be seen in this notebook \u003chttp://nbviewer.jupyter.org/github/scikit-learn-contrib/hdbscan/blob/master/notebooks/Benchmarking%20scalability%20of%20clustering%20implementations-v0.7.ipynb\u003e`_ .\nIn particular `performance on low dimensional data is better than sklearn's DBSCAN \u003chttp://nbviewer.jupyter.org/github/scikit-learn-contrib/hdbscan/blob/master/notebooks/Benchmarking%20scalability%20of%20clustering%20implementations%202D%20v0.7.ipynb\u003e`_ ,\nand via support for caching with joblib, re-clustering with different parameters\ncan be almost free.\n\n------------------------\nAdditional functionality\n------------------------\n\nThe hdbscan package comes equipped with visualization tools to help you\nunderstand your clustering results. After fitting data the clusterer\nobject has attributes for:\n\n* The condensed cluster hierarchy\n* The robust single linkage cluster hierarchy\n* The reachability distance minimal spanning tree\n\nAll of which come equipped with methods for plotting and converting\nto Pandas or NetworkX for further analysis. See the notebook on\n`how HDBSCAN works \u003chttp://nbviewer.jupyter.org/github/scikit-learn-contrib/hdbscan/blob/master/notebooks/How%20HDBSCAN%20Works.ipynb\u003e`_ for examples and further details.\n\nThe clusterer objects also have an attribute providing cluster membership\nstrengths, resulting in optional soft clustering (and no further compute \nexpense). Finally each cluster also receives a persistence score giving\nthe stability of the cluster over the range of distance scales present\nin the data. This provides a measure of the relative strength of clusters.\n\n-----------------\nOutlier Detection\n-----------------\n\nThe HDBSCAN clusterer objects also support the GLOSH outlier detection algorithm. \nAfter fitting the clusterer to data the outlier scores can be accessed via the\n``outlier_scores_`` attribute. The result is a vector of score values, one for\neach data point that was fit. Higher scores represent more outlier like objects.\nSelecting outliers via upper quantiles is often a good approach.\n\nBased on the paper:\n    R.J.G.B. Campello, D. Moulavi, A. Zimek and J. Sander \n    *Hierarchical Density Estimates for Data Clustering, Visualization, and Outlier Detection*, \n    ACM Trans. on Knowledge Discovery from Data, Vol 10, 1 (July 2015), 1-51.\n\n---------------------\nRobust single linkage\n---------------------\n\nThe hdbscan package also provides support for the *robust single linkage*\nclustering algorithm of Chaudhuri and Dasgupta. As with the HDBSCAN \nimplementation this is a high performance version of the algorithm \noutperforming scipy's standard single linkage implementation. The\nrobust single linkage hierarchy is available as an attribute of\nthe robust single linkage clusterer, again with the ability to plot\nor export the hierarchy, and to extract flat clusterings at a given\ncut level and gamma value.\n\nExample usage:\n\n.. code:: python\n\n    import hdbscan\n    from sklearn.datasets import make_blobs\n    \n    data = make_blobs(1000)\n    \n    clusterer = hdbscan.RobustSingleLinkage(cut=0.125, k=7)\n    cluster_labels = clusterer.fit_predict(data)\n    hierarchy = clusterer.cluster_hierarchy_\n    alt_labels = hierarchy.get_clusters(0.100, 5)\n    hierarchy.plot()\n\n\nBased on the paper:\n    K. Chaudhuri and S. Dasgupta.\n    *\"Rates of convergence for the cluster tree.\"*\n    In Advances in Neural Information Processing Systems, 2010.\n\n----------\nInstalling\n----------\n\nEasiest install, if you have Anaconda (thanks to conda-forge which is awesome!):\n\n.. code:: bash\n\n    conda install -c conda-forge hdbscan\n\nPyPI install, presuming you have sklearn and all its requirements (numpy and scipy) installed:\n\n.. code:: bash\n\n    pip install hdbscan\n\nIf pip is having difficulties pulling the dependencies then we'd suggest installing\nthe dependencies manually using anaconda followed by pulling hdbscan from pip:\n\n.. code:: bash\n\n    conda install cython\n    conda install numpy scipy\n    conda install scikit-learn\n    pip install hdbscan\n\nFor a manual install get this package:\n\n.. code:: bash\n\n    wget https://github.com/scikit-learn-contrib/hdbscan/archive/master.zip\n    unzip master.zip\n    rm master.zip\n    cd hdbscan-master\n\nInstall the requirements\n\n.. code:: bash\n\n    sudo pip install -r requirements.txt\n    \nor\n\n.. code:: bash\n\n    conda install scikit-learn cython \n\nInstall the package\n\n.. code:: bash\n\n    python setup.py install\n    \n--------------\nPython Version\n--------------\n\nThe hdbscan library supports both Python 2 and Python 3. However we recommend Python 3 as the better option if it is available to you.\n    \n----------------\nHelp and Support\n----------------\n\nFor simple issues you can consult the `FAQ \u003chttps://hdbscan.readthedocs.io/en/latest/faq.html\u003e`_ in the documentation.\nIf your issue is not suitably resolved there, please check the `issues \u003chttps://github.com/scikit-learn-contrib/hdbscan/issues\u003e`_ on github. Finally, if no solution is available there feel free to `open an issue \u003chttps://github.com/scikit-learn-contrib/hdbscan/issues/new\u003e`_ ; the authors will attempt to respond in a reasonably timely fashion.\n\n------------\nContributing\n------------\n\nWe welcome contributions in any form! Assistance with documentation, particularly expanding tutorials,\nis always welcome. To contribute please `fork the project \u003chttps://github.com/scikit-learn-contrib/hdbscan/issues#fork-destination-box\u003e`_ make your changes and submit a pull request. We will do our best to work through any issues with\nyou and get your code merged into the main branch.\n\n------\nCiting\n------\n\nIf you have used this codebase in a scientific publication and wish to cite it, please use the `Journal of Open Source Software article \u003chttp://joss.theoj.org/papers/10.21105/joss.00205\u003e`_.\n\n    L. McInnes, J. Healy, S. Astels, *hdbscan: Hierarchical density based clustering*\n    In: Journal of Open Source Software, The Open Journal, volume 2, number 11.\n    2017\n\n---------\nLicensing\n---------\n\nThe hdbscan package is 3-clause BSD licensed. Enjoy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmcinnes%2Fhdbscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmcinnes%2Fhdbscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmcinnes%2Fhdbscan/lists"}