需要多少个簇?

Python 中的聚类分析

Shaumik Daityari

Business Analyst

树状图简介

  • 目前策略:凭可视化判断簇数
  • 树状图展示合并过程
  • 树状图是分支图,显示每个簇如何由其子节点组成

Python 中的聚类分析

在 SciPy 中创建树状图

from scipy.cluster.hierarchy import dendrogram
Z = linkage(df[['x_whiten', 'y_whiten']], 
            method='ward',
            metric='euclidean')

dn = dendrogram(Z) plt.show()
Python 中的聚类分析

Python 中的聚类分析

Python 中的聚类分析

Python 中的聚类分析

Python 中的聚类分析

Python 中的聚类分析

接下来——做些练习

Python 中的聚类分析

Preparing Video For Download...