SciPy

This is documentation for an old release of SciPy (version 1.6.1). Read this page in the documentation of the latest stable release (version 1.15.1).

Clustering package (scipy.cluster)

scipy.cluster.vq

Clustering algorithms are useful in information theory, target detection, communications, compression, and other areas. The vq module only supports vector quantization and the k-means algorithms.

scipy.cluster.hierarchy

The hierarchy module provides functions for hierarchical and agglomerative clustering. Its features include generating hierarchical clusters from distance matrices, calculating statistics on clusters, cutting linkages to generate flat clusters, and visualizing clusters with dendrograms.