Question

I am trying to use Python fastcluster module for hierarchical clustering:

linkage = fastcluster.linkage(distance,method="complete")

It works fine when I know beforehand the number of clusters. But I can not find the syntax for cutting point in the gained hierarchy. I appreciate any help in this direction.

Was it helpful?

Solution

You have first set your criteria. Based on this criteria you can choose cutoff values. for example:

X = np.array([.....])
Y = pdist(X)
Z = linkage(Y)
I = inconsistent(Z)

Then based on consistency results select your cutoff point.

fcluster(Z,cutoff,criterion='inconsistent')

see fcluster documentation for further help

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top