class nltk.cluster.Dendrogram(items=[])[source]

Represents a dendrogram, a tree with a specified branching order. This must be initialised with the leaf items, then iteratively call merge for each branch. This class constructs a tree representing the order of calls to the merge function.


param items:the items at the leaves of the dendrogram
groups(n) Finds the n-groups of items (leaves) reachable from a cut at depth n.
merge(*indices) Merges nodes at given indices in the dendrogram.
show([leaf_labels]) Print the dendrogram in ASCII art to standard out.