Hierarchical Clustering
Hierarchical Clustering
• Distance Matrix:
• A B C D E
• A 0.00 1.41 2.83 9.22 11.31
• B 1.41 0.00 1.41 7.81 9.90
• C 2.83 1.41 0.00 6.08 8.24
• D 9.22 7.81 6.08 0.00 2.83
• E 11.31 9.90 8.24 2.83 0.00
Step 2: Initialize Clusters
• At the beginning, each point is its own cluster:
• Clusters: A, B, C, D, E
Step 3: Find the Closest Clusters
• Find the two closest clusters using the
distance matrix:
• AB C D E
• AB 0.00 1.41 7.81 9.90
• C 1.41 0.00 6.08 8.24
• D 7.81 6.08 0.00 2.83
• E 9.90 8.24 2.83 0.00
Step 6: Repeat
• Repeat merging the closest clusters until only
one cluster remains:
• 1. Merge AB and C -> ABC
• 2. Merge ABC and D -> ABCD
• 3. Merge ABCD and E -> Final Cluster
Step 7: Create a Dendrogram
• A dendrogram illustrates the sequence of
merges.
• The height of branches represents the
distance at which clusters are merged.