graphclust.cluster.HDBSCANStar#
- class graphclust.cluster.HDBSCANStar(min_cluster_size=5, *, min_samples=None, allow_single_cluster=False)[source]#
Bases:
ClusterMixin,BaseEstimatorHDBSCAN* (Campello, Moulavi and Sander 2013; 2015): density clustering from a spanning tree.
The core distance of a sample is the distance of its
min_samples-th nearest neighbor (the sample itself counted), the mutual reachability distance is \(d_{mr}(a,b)=\max\{c(a),c(b),d(a,b)\}\), and the MST of the complete mutual reachability graph encodes the whole single-linkage hierarchy of density levels. The hierarchy is condensed (splits that cut off fewer thanmin_cluster_sizesamples are treated as samples leaving a cluster) and the clusters with the largest total stability \(\sum_{x}(\lambda_x-\lambda_{\mathrm{birth}})\) are selected (excess of mass). Samples outside the selected clusters are noise (label-1).HDBSCAN* is the density-based heir of the MST clustering of Zahn: the tree is the same object, but the edge weights are density-corrected and the cut is chosen by stability instead of a length threshold.
- Attributes:
- labels_, probabilities_ (membership strength in [0, 1]), core_distances_,
- mst_ (mutual reachability tree), condensed_tree_ (structured array),
- cluster_persistence_ (stability of the selected clusters).