Function kodama::linkage[][src]

pub fn linkage<T: Float>(
    condensed_dissimilarity_matrix: &mut [T],
    observations: usize,
    method: Method
) -> Dendrogram<T>

Return a hierarchical clustering of observations given their pairwise dissimilarities.

The pairwise dissimilarities must be provided as a condensed pairwise dissimilarity matrix, where only the values in the upper triangle are explicitly represented, not including the diagonal. As a result, the given matrix should have length observations-choose-2 and only have values defined for pairs of (a, b) where a < b.

observations is the total number of observations that are being clustered. Every pair of observations must have a finite non-NaN dissimilarity.

The return value is a Dendrogram, which encodes the hierarchical clustering as a sequence of observations - 1 steps, where each step corresponds to the creation of a cluster by merging exactly two previous clusters. The very last cluster created contains all observations.