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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top