Pruning dendrogram at levels in Scipy Hierarchical Clustering

烂漫一生 提交于 2019-12-06 09:23:20

As specified in the scipy documentation, if a cluster node is under color_threshold, then all of its descendants will be the same color (not blue). The links connecting nodes above color_threshold will be blue.

In your example, color_threshold=1. Since all the nodes are above 1, all of the links are blue.

Try instead

Z = dendrogram(linkage_matrix,
       color_threshold=1500,
       distance_sort='ascending')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!