要分幾個群集?

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...