API Reference¶
Pyprotoclust is an implementatin of representative hierarchical clustering using minimax linkage.
Pyprotoclust takes a distance matrix as input. It returns a linkage matrix encoding the hierachical clustering as well as an additional list labelling the prototypes associated with each clustering. This allows a user to integrate with the existing tools in the SciPy hierarchical clustering module.
-
pyprotoclust.protoclust(distance_matrix, verbose=False, notebook=False)¶ An implementatin of representative hierarchical clustering using minimax linkage.
- Parameters
distance_matrix (
ndarrayof float) – A distance matrix to be clustered. Must be accessible with index pairs.verbose (bool) – Optional. Print a progress bar. Default False.
notebook (bool) – Optional. Flag if using a jupyter notebook to allow progress bar to print. Default False.
- Returns
tuple containing:
ndarray: ZThe linkage matrix encoding the hierarchical clustering. See scipy.cluster.hierarchy.linkage for information about the format of Z.
ndarray: prototypesThe prototypes associated with cluster at each linkage iteration. The length of this list is equal to the size of the input data plus the length of Z.
- Return type
(tuple)