Hierarchical Clustering
- Why Hierarchical Clustering?
- Types of Hierarchical Clustering
- Agglomerative Hierarchical Clustering Algorithm
- Working of Hierarchical Clustering
- Advantages of Hierarchical Clustering
- Disadvantages of Hierarchical Clustering
- Identifying the two clusters that are closest to each other.
- Merging the two most similar clusters. This merging process continues until all clusters are amalgamated.
While the outcomes of K-means clustering and hierarchical clustering Python might seem alike at times, their methodologies differ significantly based on their operational approach. The starting set of clusters is not needed to calculate hierarchical clustering, and this is a major difference between K-means and the hierarchy. Hierarchical clustering, also known as the hierarchical classification machine learning cluster analysis, yields a structured diagram of clusters within a dataset. The hierarchical clustering procedure initiates by considering each data point as a separate cluster, discovering the clusters’ closest neighbors, and combining them until the calculated stopping threshold is reached.
Why do we need Hierarchical
Clustering?
Hierarchical clustering
is markedly different from K-means in that it doesn't need calculations of the
initial cluster set. Named also hierarchical cluster analysis, the hierarchical
clustering method gives a ranked diagram or dendrogram for the dataset. The
hierarchical clustering algorithm finds, for each cluster, its nearest
neighbors first to establish an initial cluster and then merges these with
others progressively (towards both larger sizes and finer structures) until
what seems to happen most often is that two clusters fall apart.
Real-World Example for Hierarchical Clustering
Let’s suppose there is a
village. In this village, there are many farmers live who grow many different grains and vegetables in this village nature lovers also live. Even it is ideal to live the villagers face challenges in
organizing their annual Harvest Festival.
To overcome this
challenge the villagers, hire Emma an event planner. She knew that she needed a
more strategic approach, so Emma turned to hierarchical clustering to organize
the festival activities and attractions.
Emma began by gathering
data on the festival’s past attendance, popular attractions, and demographic
preferences. After gaining all this information, she applied hierarchical
clustering to group similar festival activities and identify clusters of
interest.
As the clustering
algorithm went through the data, Emma discovered several different clusters of
festival attractions. One cluster includes traditional harvest-themed
activities such as pumpkin carving and apple picking, while another comprises
live music performances and artisanal craft stalls. She also found a cluster
focused on children’s entertainment, featuring interactive games and storytelling
sessions.
Using these insights,
Emma devised a tiered approach to organizing the Harvest Festival. She created
a hierarchical structure with main clusters representing broad categories of
attractions and subclusters highlighting specific activities within each category.
This method allowed participants to quickly browse through the many attractions and select the ones that most closely matched their preferences. Young families may explore the children's amusement group, and foodies might taste delicious meals in the food and drink area.
Types of Hierarchical Clustering
- Agglomerative clustering analysis
- Divisive clustering
Agglomerative
Hierarchical Clustering, a popular method in hierarchical cluster analysis
(HCA), follows a bottom-up approach. It starts by treating each data point as a
separate cluster. Then, in each iteration, it merges the closest pair of
clusters until all clusters are merged into a single cluster encompassing the
entire dataset.
Agglomerative clustering algorithm
- Compute the similarity between each cluster and all other clusters, resulting in a proximity matrix.
- Initially, treat each data point as its cluster.
- Merge clusters that exhibit high similarity or proximity.
- Reassess the proximity matrix for each newly formed cluster.
- Iterate through steps 3 and 4 until only one cluster remains.
Let’s look at algorithms
working in a little detail and understand them with images.
Agglomerative clustering example
In the first step, we create each point as a single cluster. If there are N data points then there will be N clusters as shown in the below image.
After each cluster is combined into one big cluster then we can make a
dendrogram (as shown in the above image) which divides the clusters according
to the problem.
Divisive Hierarchical clustering
Working of dendrogram in
Hierarchical clustering
- The initial step shows the combination of data points P2 and P3, forming a cluster, which is reflected in the dendrogram by the connection between P2 and P3. The height in the dendrogram signifies the Euclidean distance between these data points.
- Subsequently, another cluster is formed by P5 and P6, and its corresponding dendrogram emerges. The height of this linkage is greater than the last one, indicating a slightly bigger distance along P5 and P6 compared to P2 and P3.
- Two additional dendrograms are created, combining P1, P2, and P3 into one dendrogram, and P4, P5, and P6 into another.
- Finally, a final dendrogram is constructed, amalgamating all the data points together.
- Its capability to accommodate non-convex clusters, also clusters of various sizes and densities, makes it versatile for diverse datasets.
- Effective handling of missing and noisy data, contributing to robustness in the clustering process.
- The hierarchical structure revealed by the dendrogram provides valuable insights into the relationships among clusters, helping to comprehend intricate inter-cluster connections within the dataset.
- Determining a stopping criterion to ascertain the final number of clusters, which can be subjective and challenging.
- Higher computational demands, and memory requirements, especially with larger datasets.
- Sensitivity to initial conditions, impacting the final clusters identified.
- Despite its ability to handle diverse data and unveil relationships among clusters, its high computational cost and sensitivity to specific conditions remain notable drawbacks.
An unsupervised method
for building a hierarchy of clusters is called hierarchical clustering. It
arranges data into a structure like a tree, with each node standing in a
cluster. Based on how similar the two clusters are, it might be agglomerative
(bottom-up) or divisive (top-down), merging or dividing them. The number of
clusters can be determined at any time using hierarchical clustering, which
also provides information about the connections between the data points. But
for huge datasets, it can be computationally demanding, and once it's set up,
there's no way to go back and change the hierarchy.
No comments:
Post a Comment