{ } Raw JSON

bundles / scipy latest / scipy / cluster / _hierarchy / fast_linkage

cython_function_or_method

scipy.cluster._hierarchy:fast_linkage

Signature

def   fast_linkage ( dists n method )

Summary

Perform hierarchy clustering.

Extended Summary

It implements "Generic Clustering Algorithm" from [1]. The worst case time complexity is O(N^3), but the best case time complexity is O(N^2) and it usually works quite close to the best case.

Parameters

dists : ndarray

A condensed matrix stores the pairwise distances of the observations.

n : int

The number of observations.

method : int

The linkage method. 0: single 1: complete 2: average 3: centroid 4: median 5: ward 6: weighted

Returns

Z : ndarray, shape (n - 1, 4)

Computed linkage matrix.

Aliases

  • scipy.cluster._hierarchy.fast_linkage