Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cluster(self, min_cluster_size=None, cluster_selection_method='eom',
allow_single_cluster=False,
match_reference_implementation=False):
"""Returns: (labels, probs, stabilities, condensed_tree, slt, mst)."""
if min_cluster_size is None:
min_cluster_size = self.min_samples
self.update_mst()
mst = np.array(self._mst_edges).astype(np.double)
mst = np.concatenate((mst[:, 1:3], mst[:, 0].reshape(-1, 1)), axis=1)
slt = hdbscan_.label(mst)
condensed_tree = hdbscan_.condense_tree(slt, min_cluster_size)
stability_dict = hdbscan_.compute_stability(condensed_tree)
lps = hdbscan_.get_clusters(condensed_tree,
stability_dict,
cluster_selection_method,
allow_single_cluster,
match_reference_implementation)
return lps + (condensed_tree, slt, mst)