Welcome to DeBaCl

DeBaCl is a Python library for estimation of density level set trees and nonparametric density-based clustering. Level set trees are based on the statistically-principled definition of clusters as modes of a probability density function. They are particularly useful for analyzing structure in complex datasets that exhibit multi-scale clustering behavior. DeBaCl is intended to promote the practical use of level set trees through improvements in computational efficiency, flexible algorithms, and an emphasis on modularity and user customizability.

Level Set Tree constructors

construct_tree Construct a level set tree from tabular data.
construct_tree_from_graph Construct a level set tree from a similarity graph and a density estimate.
load_tree Load a saved tree from file.

Level Set Tree model

LevelSetTree Level Set Tree attributes and methods.
LevelSetTree.prune Prune the tree by recursively merging small leaf nodes into larger sibling nodes.
LevelSetTree.save Save a level set tree object to file.
LevelSetTree.plot Plot the level set tree as a dendrogram and return coordinates and colors of the branches.
LevelSetTree.get_clusters Generic function for retrieving cluster labels from the level set tree.
LevelSetTree.get_leaf_nodes Return the indices of leaf nodes in the level set tree.

Utilities

knn_graph Compute the symmetric k-nearest neighbor graph for a set of points.
epsilon_graph Construct an epsilon-neighborhood graph, represented by an adjacency list.
knn_density Compute the kNN density estimate for a set of points.
define_density_mass_grid Create a grid of density levels with a uniform number of points between each level.
define_density_level_grid Create an evenly spaced grid of density levels.
reindex_cluster_labels Re-index integer cluster labels to be consecutive non-negative integers.