Skip to main content
Help us improve Python packaging – donate today!

Clustering based on density with variable density clusters

Project Description

HDBSCAN - Hierarchical Density-Based Spatial Clustering of Applications with Noise. Performs DBSCAN over varying epsilon values and integrates the result to find a clustering that gives the best stability over epsilon. This allows HDBSCAN to find clusters of varying densities (unlike DBSCAN), and be more robust to parameter selection.

Based on the paper:
R. Campello, D. Moulavi, and J. Sander, Density-Based Clustering Based on Hierarchical Density Estimates In: Advances in Knowledge Discovery and Data Mining, Springer, pp 160-172. 2013

Notebooks comparing HDBSCAN to other clustering algorithms, and explaining how HDBSCAN works are available.

How to use HDBSCAN

The hdbscan package inherits from sklearn classes, and thus drops in neatly next to other sklearn clusterers with an identical calling API. Similarly it supports input in a variety of formats: an array (or pandas dataframe, or sparse matrix) of shape (num_samples x num_features); an array (or sparse matrix) giving a distance matrix between samples.

import hdbscan

clusterer = hdbscan.HDBSCAN(min_cluster_size=10)
cluster_labels = clusterer.fit_predict(data)

Note that clustering larger datasets will require significant memory (as with any algorithm that needs all pairwise distances). Support for low memory/better scaling is planned but not yet implemented.

Installing

Fast install

pip install hdbscan

For a manual install get this package:

wget https://github.com/lmcinnes/hdbscan/archive/master.zip
unzip master.zip
rm master.zip
cd hdbscan-master

Install the requirements

sudo pip install -r requirements.txt

Install the package

python setup.py install

Licensing

The hdbscan package is BSD licensed. Enjoy.

Release history Release notifications

History Node

0.8.12

History Node

0.8.11

History Node

0.8.10

History Node

0.8.8

History Node

0.8.7

History Node

0.8.6

History Node

0.8.5

History Node

0.8.4

History Node

0.8.3

History Node

0.8.2

History Node

0.8.1

History Node

0.8

History Node

0.7.3

History Node

0.7.2

History Node

0.7.1

History Node

0.7

History Node

0.6.5

History Node

0.6.4

History Node

0.6.2

History Node

0.6.1

History Node

0.6

History Node

0.5

History Node

0.4.2

History Node

0.4.1

History Node

0.4

History Node

0.3.1

This version
History Node

0.3

History Node

0.2

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
hdbscan-0.3.tar.gz (151.1 kB) Copy SHA256 hash SHA256 Source None Oct 21, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page