# level_set_tree.LevelSetTree.branch_partition¶

LevelSetTree.branch_partition()

Partition the input data. Each instance’s assigned label is the index of the highest density node to which the point belongs. This is similar to retrieving high-density clusters with background points labeled, except here the background points are labeled according to their internal node membership as well (not just that they’re background points).

Returns: labels : 2-dimensional numpy array Each row corresponds to an observation. The first column indicates the index of the observation in the original data matrix, and the second column is the index of the LST node to which the observation belongs.

Examples

>>> X = numpy.random.rand(100, 2)
>>> tree = debacl.construct_tree(X, k=8, prune_threshold=5)
>>> labels = tree.branch_partition()