This is documentation for an old release of SciPy (version 1.1.0). Read this page in the documentation of the latest stable release (version 1.15.1).
scipy.cluster.hierarchy.maxdists¶
-
scipy.cluster.hierarchy.
maxdists
(Z)[source]¶ Return the maximum distance between any non-singleton cluster.
Parameters: - Z : ndarray
The hierarchical clustering encoded as a matrix. See
linkage
for more information.
Returns: - maxdists : ndarray
A
(n-1)
sized numpy array of doubles;MD[i]
represents the maximum distance between any cluster (including singletons) below and including the node with index i. More specifically,MD[i] = Z[Q(i)-n, 2].max()
whereQ(i)
is the set of all node indices below and including node i.