0

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.

4

1 回答 1

2

你首先设定了你的标准。根据此标准,您可以选择截止值。例如:

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

然后根据一致性结果选择您的截止点。

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

请参阅 fcluster 文档以获取更多帮助

于 2013-12-25T21:48:24.503 回答