scipy.cluster.hierarchy.correspond

scipy.cluster.hierarchy.correspond(Z, Y)

Checks if a linkage matrix Z and condensed distance matrix Y could possibly correspond to one another.

They must have the same number of original observations for the check to succeed.

This function is useful as a sanity check in algorithms that make extensive use of linkage and distance matrices that must correspond to the same set of original observations.

Parameters :

Z : ndarray

The linkage matrix to check for correspondance.

Y : ndarray

The condensed distance matrix to check for correspondance.

Returns :

b : bool

A boolean indicating whether the linkage matrix and distance matrix could possibly correspond to one another.

Previous topic

scipy.cluster.hierarchy.is_monotonic

Next topic

scipy.cluster.hierarchy.num_obs_linkage

This Page