Performs centroid/UPGMC linkage.
See linkage for more information on the input matrix, return structure, and algorithm.
The following are common calling conventions:
Z = centroid(y)
Performs centroid/UPGMC linkage on the condensed distance matrix y. See linkage for more information on the return structure and algorithm.
Z = centroid(X)
Performs centroid/UPGMC linkage on the observation matrix X using Euclidean distance as the distance metric. See linkage for more information on the return structure and algorithm.
y : ndarray
A condensed distance matrix. A condensed distance matrix is a flat array containing the upper triangular of the distance matrix. This is the form that pdist returns. Alternatively, a collection of m observation vectors in n dimensions may be passed as a m by n array.
Z : ndarray
A linkage matrix containing the hierarchical clustering. See the linkage function documentation for more information on its structure.
- for advanced creation of hierarchical clusterings.