2079 6

CSC420 ยท 2079 ยท 5 marks

What are two categories of hierarchical clustering? Divide the following data points into two clusters using agglomerative clustering. { (2,10), (2,5), (8,4), (5,8), (7,5), (6,4) }

What are two categories of hierarchical clustering? Divide the following data points into two clusters using agglomerative clustering. { (2,10), (2,5), (8,4), (5,8), (7,5), (6,4) } [5]

Data Warehousing and Data MiningChapter 7: Cluster AnalysisHierarchicalNumerical: agglomerative clustering

Hierarchical Clustering: Two Categories and Agglomerative Example

Given

Data points to cluster:

  • P1 = (2, 10)
  • P2 = (2, 5)
  • P3 = (8, 4)
  • P4 = (5, 8)
  • P5 = (7, 5)
  • P6 = (6, 4)

Target: 2 clusters. Linkage method not specified; I will use single linkage (minimum distance) as is standard for this textbook problem.


Solution

Two Categories of Hierarchical Clustering

  1. Agglomerative (Bottom-Up): Each object starts as its own cluster. At each step the two closest clusters are merged, continuing until all objects form one cluster (or the desired number is reached).

  2. Divisive (Top-Down): All objects start in a single cluster, which is repeatedly split into smaller clusters until each object is alone (or the desired number is reached).


Distance Formula (Euclidean)

$$d(P_i, P_j) = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$

Initial Distance Matrix

P1P2P3P4P5P6
P105.009.225.399.069.22
P25.0006.084.245.004.12
P39.226.0805.832.242.00
P45.394.245.8303.615.00
P59.065.002.243.6101.41
P69.224.122.005.001.410

Sample checks:

  • $d(P5,P6)=\sqrt{1^2+1^2}=1.41$ (minimum)
  • $d(P3,P6)=\sqrt{2^2+0^2}=2.00$
  • $d(P3,P5)=\sqrt{1^2+1^2}=2.24$

Step A: Merge closest pair

Minimum = 1.41 (P5, P6). Merge โ†’ C1 = {P5, P6}

Clusters: {P1}, {P2}, {P3}, {P4}, {P5,P6}

Step B: Recompute (single linkage)

  • $d({P5,P6},P1)=\min(9.06,9.22)=9.06$
  • $d({P5,P6},P2)=\min(5.00,4.12)=4.12$
  • $d({P5,P6},P3)=\min(2.24,2.00)=2.00$ โ† minimum overall
  • $d({P5,P6},P4)=\min(3.61,5.00)=3.61$

Merge P3 โ†’ C1 = {P3, P5, P6}

Clusters: {P1}, {P2}, {P4}, {P3,P5,P6}

Step C: Recompute

  • $d({P3,P5,P6},P1)=\min(9.22,9.06,9.22)=9.06$
  • $d({P3,P5,P6},P2)=\min(6.08,5.00,4.12)=4.12$
  • $d({P3,P5,P6},P4)=\min(5.83,3.61,5.00)=3.61$ โ† minimum overall

(Others: $d(P1,P2)=5.00,\ d(P1,P4)=5.39,\ d(P2,P4)=4.24$)

Merge P4 โ†’ C1 = {P3, P4, P5, P6}

Clusters: {P1}, {P2}, {P3,P4,P5,P6}

Step D: Recompute

  • $d({P3,P4,P5,P6},P1)=\min(9.22,5.39,9.06,9.22)=5.39$
  • $d({P3,P4,P5,P6},P2)=\min(6.08,4.24,5.00,4.12)=4.12$
  • $d(P1,P2)=5.00$

Minimum = 4.12 (between big cluster and P2). Merge P2 โ†’ C1 = {P2, P3, P4, P5, P6}

Clusters: {P1}, {P2,P3,P4,P5,P6}


Final Result (2 clusters)

We stop when exactly two clusters remain:

$$\boxed{\text{Cluster 1} = {P1} = {(2,10)}}$$ $$\boxed{\text{Cluster 2} = {P2,P3,P4,P5,P6} = {(2,5),(8,4),(5,8),(7,5),(6,4)}}$$

Point P1 = (2,10) is the outlier that separates last, forming its own cluster; all other points group together.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.