Unsupervised Learning: Hierarchical Clustering Using Agglomerative and Divisive Algorithms

Ashkan Beheshti
11 min readMar 6, 2023

In this tutorial, we will be exploring the topic of hierarchical clustering in unsupervised learning. We’ll be discussing the concept of hierarchical clustering and its differences from other clustering methods, including the agglomerative and divisive methods. We will walk you through the steps involved in agglomerative clustering, such as initialization, distance calculation, cluster merging, dendrogram generation, and determination of the number of clusters. To help you better understand the process, Python code examples are also provided. Additionally, we’ll be examining the advantages and limitations of hierarchical clustering compared to other clustering algorithms, such as K-means and Gaussian Mixture Models. Finally, we will wrap up with a discussion on the subjective nature of choosing the y-coordinate value for determining the number of clusters and the importance of defining a proper clustering criterion to achieve optimal results.

🦊 If you want to learn more about clustering in unsupervised learning, you may be interested in reading my other post “Clustering Methods 101: An Introduction to Unsupervised Learning Techniques.” This tutorial provides a comprehensive overview of different clustering methods, including hierarchical clustering, density-based clustering, and model-based clustering, and discusses their advantages and disadvantages. It also covers topics such as cluster evaluation and selection, and provides examples of clustering…

--

--

Ashkan Beheshti

Psychologist-Data Scientist, exploring the interplay between human learning & machine learning