How to use the hdbscan.hdbscan function in hdbscan

To help you get started, we’ve selected a few hdbscan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matteodellamico / flexible-clustering / flexible_clustering / fishdbc.py View on Github external
"""Simple implementation for when you don't need incremental updates."""

    n = len(data)
    distance_matrix = scipy.sparse.lil_matrix((n, n))
    
    def decorated_d(i, j):
        res = d(data[i], data[j])
        distance_matrix[i, j] = distance_matrix[j, i] = res
        return res
    
    the_hnsw = hnsw.HNSW(decorated_d, m, ef, m0, level_mult, heuristic)
    add = the_hnsw.balanced_add if balanced_add else the_hnsw.add
    for i in range(len(data)):
        add(i)

    return hdbscan.hdbscan(distance_matrix, metric='precomputed', **kwargs)

hdbscan

Clustering based on density with variable density clusters

BSD-3-Clause
Latest version published 3 days ago

Package Health Score

91 / 100
Full package analysis