我正在为Aggregatemative Hierarchical集群工作。我找到了输出图。但是我不明白从该图中可以接受多少聚类。如何计算群集数?
我的代码:
from scipy.cluster.hierarchy import ward,dendrogram,linkage
np.set_printoptions(precision=4,suppress=True)
distance = linkage(Y,'ward')
plt.title("Hierarchical Clustering Dendogram")
plt.xlabel('Sample Index/Clusyer Size', fontsize = 10)
plt.ylabel('Distance', fontsize = 10)
dendrogram(distance, leaf_rotation=90, leaf_font_size=9);
plt.axhline(98, c= 'k')
plt.show()
我的输出图:
它显示Cluster =6。水平线从Y轴到X轴穿过六个块