Compute the optimal leaf ordering of a hierarchical binary cluster tree.
The optimal leaf ordering of a tree is the ordering which minimizes the sum of the distances between each leaf and its adjacent leaves, without altering the structure of the tree, that is without redefining the clusters of the tree.
Required inputs:
linkage
function.
pdist
.
Optional inputs can be the following property/value pairs:
optimalleaforder’s output leafOrder is the optimal leaf ordering.
Reference Bar-Joseph, Z., Gifford, D.K., and Jaakkola, T.S. Fast optimal leaf ordering for hierarchical clustering. Bioinformatics vol. 17 suppl. 1, 2001.
See also: dendrogram,linkage,pdist.
The following code
X = randn (10, 2); D = pdist (X); tree = linkage(D, 'average'); optimalleaforder (tree, D, 'Transformation', 'linear')
Produces the following output
ans = 4 9 10 1 7 8 6 2 5 3
Package: statistics