문제

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