How many clusters?

Cluster Analysis in Python

Shaumik Daityari

Business Analyst

Introduction to dendrograms

  • Strategy till now - decide clusters on visual inspection
  • Dendrograms help in showing progressions as clusters are merged
  • A dendrogram is a branching diagram that demonstrates how each cluster is composed by branching out into its child nodes

Cluster Analysis in Python

Create a dendrogram in SciPy

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

dn = dendrogram(Z) plt.show()
Cluster Analysis in Python

Cluster Analysis in Python

Cluster Analysis in Python

Cluster Analysis in Python

Cluster Analysis in Python

Cluster Analysis in Python

Next up - try some exercises

Cluster Analysis in Python

Preparing Video For Download...