{"id":8011,"date":"2020-12-29T00:26:22","date_gmt":"2020-12-29T00:26:22","guid":{"rendered":"https:\/\/healinglifespan.com\/data-science\/2020\/12\/29\/how-the-hierarchical-clustering-algorithm-works\/"},"modified":"2020-12-29T00:26:22","modified_gmt":"2020-12-29T00:26:22","slug":"how-the-hierarchical-clustering-algorithm-works","status":"publish","type":"post","link":"https:\/\/wealthrevelation.com\/data-science\/2020\/12\/29\/how-the-hierarchical-clustering-algorithm-works\/","title":{"rendered":"How the Hierarchical Clustering Algorithm Works"},"content":{"rendered":"<div id=\"tve_editor\" data-post-id=\"8023\">\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17683f8599b\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/1-Hierarchical-Clustering.png?resize=626%2C376&amp;ssl=1\" class=\"tve_image wp-image-8025\" alt=\"Hierarchical Clustering Algorithm\" data-id=\"8025\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"Hierarchical Clustering Algorithm\" loading=\"lazy\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8025\" alt=\"Hierarchical Clustering Algorithm\" data-id=\"8025\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"Hierarchical Clustering Algorithm\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/1-Hierarchical-Clustering.png?resize=626%2C376&amp;ssl=1\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\" data-css=\"tve-u-17683f859a4\">\n<p dir=\"ltr\">\u00a0 Hierarchical Clustering is an <a href=\"https:\/\/dataaspirant.com\/supervised-and-unsupervised-learning\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\"><strong>unsupervised Learning Algorithm<\/strong><\/a>, and this is one of the most popular clustering technique in Machine Learning.\u00a0<\/p>\n<p dir=\"ltr\">Expectations of getting insights from machine learning algorithms is increasing abruptly. Initially, we were limited to predict the future by feeding historical data.\u00a0<\/p>\n<p dir=\"ltr\">This is easy when the <strong>expected results and the features<\/strong> in the historical data are available to build the supervised learning models, which can predict the future.<\/p>\n<p dir=\"ltr\">For example predicting the <a href=\"https:\/\/dataaspirant.com\/build-email-spam-classification-model-spacy-python\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>email is spam or not<\/strong><\/a>, using the historical email data.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_tw_qs tve_clearfix\" data-url=\"https:\/\/twitter.com\/intent\/tweet\" data-via=\"\" data-use_custom_url=\"\" data-css=\"tve-u-17683f859e0\">\n<div class=\"thrv_tw_qs_container\">\n<div class=\"thrv_tw_quote\">\n<p class=\"\">Learn hierarchical clustering algorithm in detail also, learn about agglomeration and divisive way of hierarchical clustering. #clustering #hierarchicalclustering<\/p>\n<\/p><\/div>\n<p>\n\t\t\t<span><br \/>\n\t\t\t\t<i><\/i><br \/>\n\t\t\t\t<span class=\"thrv_tw_qs_button_text  thrv-inline-text tve_editable\">Click to Tweet<\/span><br \/>\n\t\t\t<\/span>\n\t\t<\/p>\n<\/p><\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17683f859e2\">\n<p dir=\"ltr\">But the real world problems are not limited to supervised type, and we do get the unsupervised problems too.<\/p>\n<blockquote class=\"\"><p><strong>How to build the models for such problems?<\/strong>\u00a0<\/p><\/blockquote>\n<p dir=\"ltr\">Where comes the unsupervised learning algorithms. <\/p>\n<p dir=\"ltr\">In this article, we are going to learn one such popular unsupervised learning \u00a0algorithm which is hierarchical clustering algorithm.<\/p>\n<p dir=\"ltr\">Before we start learning, Let\u2019s look at the topics you will learn in this article. Only if you read the complete article \ud83d\ude42<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17683f859e4\">\n<p dir=\"ltr\">Before we understand what hierarchical clustering is, its benefits, and how it works. Let us learn the unsupervised learning algorithm topic.<\/p>\n<h2 id=\"t-1608531820428\" class=\"\">What is Unsupervised Learning<\/h2>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17683fbe173\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/2-What-Is-Unsupervised-Learning.png?resize=626%2C376&amp;ssl=1\" class=\"tve_image wp-image-8035\" alt=\"What Is Unsupervised Learning\" data-id=\"8035\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"What Is Unsupervised Learning\" loading=\"lazy\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8035\" alt=\"What Is Unsupervised Learning\" data-id=\"8035\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"What Is Unsupervised Learning\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/2-What-Is-Unsupervised-Learning.png?resize=626%2C376&amp;ssl=1\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Unsupervised learning is training a machine using information that is <strong>neither classified nor labeled<\/strong> and allows the machine to act on that information <strong>without<\/strong> guidance.\u00a0<\/p>\n<p dir=\"ltr\">In Unsupervised Learning, a machine\u2019s task is to group unsorted information according to <a href=\"https:\/\/dataaspirant.com\/five-most-popular-similarity-measures-implementation-in-python\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>similarities, patterns<\/strong><\/a>, and differences without any prior data training. It is defined as<\/p>\n<blockquote class=\"\"><p>\u00a0 \u00a0 \u201cUnsupervised Learning Algorithm is a machine learning technique, where you don\u2019t have to supervise the model. Rather, you need to allow the model to work on its own to discover information, and It mainly deals with unlabelled data.\u201d<\/p><\/blockquote>\n<p dir=\"ltr\">If you want to know more, we would suggest you to read the <a href=\"https:\/\/dataaspirant.com\/supervised-and-unsupervised-learning\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>unsupervised learning algorithms<\/strong><\/a> article.<\/p>\n<h3 id=\"t-1608531820429\" class=\"\">Types of Unsupervised Learning Algorithm<\/h3>\n<p dir=\"ltr\">Unsupervised Learning algorithms are classified into two categories.<\/p>\n<ul class=\"\">\n<li><strong>Clustering: <\/strong>Clustering is a technique of grouping objects into clusters. Objects with the most similarities remain in a group and have less or no similarities with another group\u2019s objects.<\/li>\n<li><strong>Association:<\/strong> Association rule in unsupervised learning method, which helps in finding the relationships between variables in a large database.\u00a0<\/li>\n<\/ul>\n<h3 id=\"t-1608531820430\" class=\"\">Unsupervised Learning Algorithms\u00a0<\/h3>\n<p dir=\"ltr\">The list of some popular Unsupervised Learning algorithms are:<\/p>\n<ul class=\"\">\n<li><a href=\"https:\/\/dataaspirant.com\/k-means-clustering-algorithm\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>K-means Clustering<\/strong><\/a><\/li>\n<li>Hierarchical Clustering<\/li>\n<li>Principal Component Analysis<\/li>\n<li>Apriori Algorithm<\/li>\n<li>Anomaly detection<\/li>\n<li>Independent Component Analysis<\/li>\n<li>Singular value decomposition<\/li>\n<\/ul>\n<p dir=\"ltr\">Before we learn about <a href=\"https:\/\/dataaspirant.com\/hierarchical-clustering-r\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>hierarchical clustering<\/strong><\/a>, we need to know about clustering and how it is different from classification.<\/p>\n<h2 id=\"t-1608531820431\" class=\"\">What is Clustering<\/h2>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17683fdea9f\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/3-What-Is-Clustering.png?resize=626%2C376&amp;ssl=1\" class=\"tve_image wp-image-8038\" alt=\"What Is Clustering\" data-id=\"8038\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"What Is Clustering\" loading=\"lazy\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8038\" alt=\"What Is Clustering\" data-id=\"8038\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"What Is Clustering\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/3-What-Is-Clustering.png?resize=626%2C376&amp;ssl=1\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Clustering is an important technique when it comes to the unsupervised learning algorithm. Clustering mainly deals with finding a structure or pattern in a collection of uncategorized data.<\/p>\n<p dir=\"ltr\">It is a technique that groups similar objects such that objects in the same group are identical to each other than the objects in the other groups. The group of similar objects is called a Cluster.<\/p>\n<h3 id=\"t-1608531820432\" class=\"\">How is clustering different from classification?<\/h3>\n<p dir=\"ltr\">As a <a href=\"https:\/\/dataaspirant.com\/for-beginners\/\" class=\"tve-froala fr-basic\" data-css=\"tve-u-176857c4af2\">data science beginner<\/a>, the difference between clustering and classification is confusing. So as the initial step, let us understand the fundamental difference between <strong><a href=\"https:\/\/dataaspirant.com\/classification-clustering-alogrithms\/\" class=\"tve-froala\">classification and clustering<\/a>. <\/strong><\/p>\n<p dir=\"ltr\">For example,<\/p>\n<p dir=\"ltr\">Let us say we have <strong>four categories<\/strong>:\u00a0<\/p>\n<ol>\n<li>Dog\u00a0<\/li>\n<li>Cat<\/li>\n<li>Shark<\/li>\n<li>Goldfish<\/li>\n<\/ol>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17683feda21\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/5-Clustering-Vs-Classification-Example.png?resize=626%2C376&amp;ssl=1\" class=\"tve_image wp-image-7763\" alt=\"Clustering Vs Classification Example\" data-id=\"7763\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"Clustering Vs Classification Example\" loading=\"lazy\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7763\" alt=\"Clustering Vs Classification Example\" data-id=\"7763\" width=\"626\" data-init-width=\"750\" height=\"376\" data-init-height=\"450\" title=\"Clustering Vs Classification Example\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/5-Clustering-Vs-Classification-Example.png?resize=626%2C376&amp;ssl=1\" data-width=\"626\" data-height=\"376\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">In this scenario, clustering would make 2 clusters. The one who lives on land and the other one lives in water.\u00a0<\/p>\n<p dir=\"ltr\">So the entities of the first cluster would be dogs and cats. Similarly, for the second cluster, it would be sharks and goldfishes.\u00a0<\/p>\n<p dir=\"ltr\">But in classification, it would <a href=\"https:\/\/dataaspirant.com\/implement-multinomial-logistic-regression-python\/\" class=\"tve-froala fr-basic\" data-css=\"tve-u-176857dea5d\">classify the four categories<\/a> into four different classes. One for each category. <\/p>\n<p dir=\"ltr\">So dogs would be classified under the class dog, and similarly, it would be for the rest.<\/p>\n<p dir=\"ltr\"><strong><a href=\"https:\/\/dataaspirant.com\/classification-and-prediction\/\" class=\"tve-froala\">In classification<\/a>,<\/strong> we have labels to tell us and supervise whether the classification is right or not, and that is how we can classify them right. Thus making it a <strong><a href=\"https:\/\/dataaspirant.com\/supervised-and-unsupervised-learning\/\" class=\"tve-froala\">supervised learning algorithm<\/a>. <\/strong><\/p>\n<p dir=\"ltr\">But in clustering, despite distinctions, we cannot classify them because we don\u2019t have labels for them. And that is why clustering is an <strong><a href=\"https:\/\/dataaspirant.com\/supervised-and-unsupervised-learning\/\" class=\"tve-froala\">unsupervised learning algorithm<\/a><\/strong>.<\/p>\n<p dir=\"ltr\">In real life, we can expect high volumes of data without labels. Because of such great use, clustering techniques have many real-time situations to help. Let us understand that.<\/p>\n<h3 id=\"t-1608531820433\" class=\"\">Applications of Clustering <\/h3>\n<p dir=\"ltr\">Clustering has a large number of applications spread across various domains. Some of the most popular applications of clustering are:<\/p>\n<ul class=\"\">\n<li><a href=\"https:\/\/dataaspirant.com\/recommendation-engine-part-1\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Recommendation Engines<\/strong><\/a><\/li>\n<li>Clustering similar news articles<\/li>\n<li>Medical Imaging<\/li>\n<li>Image Segmentation<\/li>\n<li>Anomaly detection<\/li>\n<li>Pattern Recognition<\/li>\n<\/ul>\n<p dir=\"ltr\">Till now, we got the in depth idea of what is unsupervised learning\u00a0 and its types. We also learned what clustering and various applications of the clustering algorithm.<\/p>\n<p dir=\"ltr\">Now have a look at a detailed explanation of what is <strong>hierarchical clustering<\/strong> and why it is used?<\/p>\n<h2 id=\"t-1608531820434\" class=\"\">What is Hierarchical Clustering<\/h2>\n<p dir=\"ltr\">Hierarchical clustering is one of the popular clustering techniques after <a href=\"https:\/\/dataaspirant.com\/k-means-clustering-algorithm\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>K-means Clustering<\/strong><\/a>. It is also known as Hierarchical Clustering Analysis (HCA)\u00a0<\/p>\n<p dir=\"ltr\">Which is used to group unlabelled datasets into a Cluster. This Hierarchical Clustering technique builds clusters based on the <a href=\"https:\/\/dataaspirant.com\/five-most-popular-similarity-measures-implementation-in-python\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>similarity<\/strong><\/a> between different objects in the set.\u00a0<\/p>\n<p dir=\"ltr\">It goes through the various features of the data points and looks for the similarity between them.\u00a0<\/p>\n<p dir=\"ltr\">This process will continue until the dataset has been grouped. Which creates a <strong>hierarchy<\/strong> for each of these clusters. <\/p>\n<p dir=\"ltr\">Hierarchical Clustering deals with the data in the form of a tree or a <strong>well-defined hierarchy<\/strong>.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1768400ec82\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/5-Hierarchical-Clustering-Types-Agglomerative-and-Divisive.png?resize=626%2C254&amp;ssl=1\" class=\"tve_image wp-image-8046\" alt=\"Hierarchical Clustering Types Agglomerative and Divisive\" data-id=\"8046\" width=\"626\" data-init-width=\"2192\" height=\"254\" data-init-height=\"890\" title=\"Hierarchical Clustering Types Agglomerative and Divisive\" loading=\"lazy\" data-width=\"626\" data-height=\"254\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8046\" alt=\"Hierarchical Clustering Types Agglomerative and Divisive\" data-id=\"8046\" width=\"626\" data-init-width=\"2192\" height=\"254\" data-init-height=\"890\" title=\"Hierarchical Clustering Types Agglomerative and Divisive\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/5-Hierarchical-Clustering-Types-Agglomerative-and-Divisive.png?resize=626%2C254&amp;ssl=1\" data-width=\"626\" data-height=\"254\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Because of this reason, the algorithm is named as a hierarchical clustering algorithm. <\/p>\n<p dir=\"ltr\">This hierarchy way of clustering can be performed in two ways.<\/p>\n<ul class=\"\">\n<li><strong>Agglomerative: <\/strong>Hierarchy created from bottom to top.\u00a0<\/li>\n<li><strong>Divisive:<\/strong> Hierarchy created from top to bottom.<\/li>\n<\/ul>\n<p dir=\"ltr\">In the next section of this article, let\u2019s learn about these two ways in detail. For now, the above image gives you a high level of understanding.\u00a0<\/p>\n<p dir=\"ltr\">In the early sections of this article, we were given various algorithms to perform the clustering. But how is this hierarchical clustering different from other techniques?<\/p>\n<p dir=\"ltr\">Let\u2019s discuss that.<\/p>\n<h2 id=\"t-1608531820435\" class=\"\">Why Hierarchical Clustering<\/h2>\n<p dir=\"ltr\">As we already have some clustering algorithms such as K-Means Clustering, then why do we need Hierarchical Clustering?\u00a0<\/p>\n<p dir=\"ltr\">As we have already seen in the <a href=\"https:\/\/dataaspirant.com\/k-means-clustering-algorithm\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>K-Means Clustering algorithm article<\/strong><\/a>, it uses a pre-specified number of clusters. It requires advanced knowledge of <strong>K<\/strong>., i.e., how to define the number of clusters one wants to divide your data.<\/p>\n<p dir=\"ltr\">Still, in hierarchical clustering no need to pre-specify the number of clusters as we did in the K-Means Clustering; one can stop at any number of clusters.\u00a0<\/p>\n<p dir=\"ltr\">Furthermore, Hierarchical Clustering has an advantage over K-Means Clustering. i.e., it results in an attractive tree-based representation of the observations, called a <strong>Dendrogram<\/strong>.<\/p>\n<h2 id=\"t-1608531820436\" class=\"\">Types of Hierarchical Clustering\u00a0<\/h2>\n<p dir=\"ltr\">The Hierarchical Clustering technique has two types.<\/p>\n<ul class=\"\">\n<li><strong>Agglomerative Hierarchical Clustering<\/strong>\n<ul>\n<li>Start with points as individual clusters.<\/li>\n<li>At each step, it merges the closest pair of clusters until only one cluster ( or K clusters left).<\/li>\n<\/ul>\n<\/li>\n<li><strong>Divisive Hierarchical Clustering<\/strong>\n<ul>\n<li>Start with one, all-inclusive cluster.<\/li>\n<li>At each step, it splits a cluster until each cluster contains a point ( or there are clusters).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 id=\"t-1608531820437\" class=\"\">Agglomerative Clustering<\/h2>\n<p dir=\"ltr\">It is also known as <strong>AGNES<\/strong> ( Agglomerative Nesting) and follows the <strong>bottom-up <\/strong>approach.\u00a0<\/p>\n<p dir=\"ltr\">Each observation starts with its own cluster, and pairs of clusters are merged as one moves up the hierarchy. <\/p>\n<p dir=\"ltr\">That means the algorithm considers each data point as a single cluster initially and then starts combining the closest pair of clusters together.\u00a0<\/p>\n<p dir=\"ltr\">It does the same process until all the clusters are merged into a single cluster that contains all the datasets.<\/p>\n<h3 id=\"t-1608531820438\" class=\"\">How does Agglomerative Hierarchical Clustering work\u00a0<\/h3>\n<p dir=\"ltr\">Let\u2019s take a sample of data and learn how the agglomerative hierarchical clustering work step by step.<\/p>\n<h4 class=\"\">Step 1<\/h4>\n<p dir=\"ltr\">First, make each data point a \u201csingle &#8211; cluster,\u201d which forms N clusters. (let\u2019s assume there are N numbers of clusters).<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1768409736d\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/6-Agglomerative-approach-step-1.png?resize=350%2C386&amp;ssl=1\" class=\"tve_image wp-image-8052\" alt=\"Agglomerative approach step 1\" data-id=\"8052\" width=\"350\" data-init-width=\"928\" height=\"386\" data-init-height=\"1024\" title=\"Agglomerative approach step 1\" loading=\"lazy\" data-width=\"350\" data-height=\"386\" data-css=\"tve-u-176855e3111\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8052\" alt=\"Agglomerative approach step 1\" data-id=\"8052\" width=\"350\" data-init-width=\"928\" height=\"386\" data-init-height=\"1024\" title=\"Agglomerative approach step 1\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/6-Agglomerative-approach-step-1.png?resize=350%2C386&amp;ssl=1\" data-width=\"350\" data-height=\"386\" data-css=\"tve-u-176855e3111\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h4 class=\"\">Step 2\u00a0<\/h4>\n<p dir=\"ltr\">Take the next two closest data points and make them one cluster; now, it forms <strong>N-1 clusters<\/strong>.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176840a4d10\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/7-Agglomerative-approach-step-2.png?resize=384%2C443&amp;ssl=1\" class=\"tve_image wp-image-8055\" alt=\"Agglomerative approach step 2\" data-id=\"8055\" width=\"384\" data-init-width=\"887\" height=\"443\" data-init-height=\"1024\" title=\"Agglomerative approach step 2\" loading=\"lazy\" data-width=\"384\" data-height=\"443\" data-css=\"tve-u-176855f3aa4\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8055\" alt=\"Agglomerative approach step 2\" data-id=\"8055\" width=\"384\" data-init-width=\"887\" height=\"443\" data-init-height=\"1024\" title=\"Agglomerative approach step 2\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/7-Agglomerative-approach-step-2.png?resize=384%2C443&amp;ssl=1\" data-width=\"384\" data-height=\"443\" data-css=\"tve-u-176855f3aa4\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h4 class=\"\">Step 3<\/h4>\n<p dir=\"ltr\">Again, take the two clusters and make them one cluster; now, it forms N-2 clusters.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176840b8eb9\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/8-Agglomerative-approach-step-3.png?resize=398%2C412&amp;ssl=1\" class=\"tve_image wp-image-8058\" alt=\"Agglomerative approach step 3\" data-id=\"8058\" width=\"398\" data-init-width=\"989\" height=\"412\" data-init-height=\"1024\" title=\"Agglomerative approach step 3\" loading=\"lazy\" data-width=\"398\" data-height=\"412\" data-css=\"tve-u-176856063e3\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8058\" alt=\"Agglomerative approach step 3\" data-id=\"8058\" width=\"398\" data-init-width=\"989\" height=\"412\" data-init-height=\"1024\" title=\"Agglomerative approach step 3\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/8-Agglomerative-approach-step-3.png?resize=398%2C412&amp;ssl=1\" data-width=\"398\" data-height=\"412\" data-css=\"tve-u-176856063e3\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h4 class=\"\">Step 4<\/h4>\n<p dir=\"ltr\">Repeat \u2018Step 3\u2019 until you are left with <strong>only one cluster<\/strong>.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176840c59d6\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/9-Agglomerative-approach-step-4.png?resize=520%2C552&amp;ssl=1\" class=\"tve_image wp-image-8061\" alt=\"Agglomerative approach step 4\" data-id=\"8061\" width=\"520\" data-init-width=\"965\" height=\"552\" data-init-height=\"1024\" title=\"Agglomerative approach step 4\" loading=\"lazy\" data-width=\"520\" data-height=\"552\" data-css=\"tve-u-1768560bdd9\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8061\" alt=\"Agglomerative approach step 4\" data-id=\"8061\" width=\"520\" data-init-width=\"965\" height=\"552\" data-init-height=\"1024\" title=\"Agglomerative approach step 4\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/9-Agglomerative-approach-step-4.png?resize=520%2C552&amp;ssl=1\" data-width=\"520\" data-height=\"552\" data-css=\"tve-u-1768560bdd9\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Once all the clusters are combined into a big cluster. We develop the Dendrogram to divide the clusters.<\/p>\n<p dir=\"ltr\">For the divisive hierarchical clustering, it treats all the data points as one cluster and splits the clustering until it creates meaningful clusters.<\/p>\n<h2 id=\"t-1608531820439\" class=\"\">Difference ways to measure the distance between two clusters<\/h2>\n<p dir=\"ltr\">There are several ways to measure the distance between in order to decide the rules for clustering, and they are often called Linkage Methods. <\/p>\n<p dir=\"ltr\">Some of the popular linkage methods are:<\/p>\n<ul class=\"\">\n<li>Simple Linkage<\/li>\n<li>Complete Linkage<\/li>\n<li>Average Linkage<\/li>\n<li>Centroid Linkage<\/li>\n<li>Ward\u2019s Linkage<\/li>\n<\/ul>\n<h3 id=\"t-1608531820440\" class=\"\">Simple Linkage<\/h3>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176840d79a6\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/10-Simple-Linkage-Method.png?resize=404%2C312&amp;ssl=1\" class=\"tve_image wp-image-8064\" alt=\"Simple Linkage Method\" data-id=\"8064\" width=\"404\" data-init-width=\"1024\" height=\"312\" data-init-height=\"791\" title=\"Simple Linkage Method\" loading=\"lazy\" data-width=\"404\" data-height=\"312\" data-css=\"tve-u-17685612b27\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8064\" alt=\"Simple Linkage Method\" data-id=\"8064\" width=\"404\" data-init-width=\"1024\" height=\"312\" data-init-height=\"791\" title=\"Simple Linkage Method\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/10-Simple-Linkage-Method.png?resize=404%2C312&amp;ssl=1\" data-width=\"404\" data-height=\"312\" data-css=\"tve-u-17685612b27\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Simple Linkage is also known as the <strong>Minimum Linkage (MIN)<\/strong> method.\u00a0<\/p>\n<p dir=\"ltr\">In the Single Linkage method, the distance of two clusters is defined as the minimum distance between an object (point) in one cluster and an object (point) in the other cluster. This method is also known as the <a href=\"https:\/\/dataaspirant.com\/k-nearest-neighbor-classifier-intro\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\"><strong>nearest neighbor method<\/strong><\/a>.<\/p>\n<h4 class=\"\" id=\"t-1608531820441\">Pros and Cons of Simple Linkage method<\/h4>\n<\/div>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-176840ee184\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone  \" data-css=\"tve-u-176840ee40f\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbulxqe6\" data-css=\"tve-u-176840ee185\">\n<div class=\"tcb-flex-row v-2 tcb--cols--2\" data-css=\"tve-u-176840ee186\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-176840ee187\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-176840ee188\">\n<div class=\"tve-cb\">\n<h4 class=\"\" id=\"t-1608531820442\">Pros of Simple Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-check\" data-css=\"tve-u-176840ee18c\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-176840ee18d\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-176840ee18f\">Simple Linkage methods can handle non-elliptical shapes.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-176840ee18d\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-176840ee18f\">Single Linkage algorithms are the best for capturing clusters of different sizes.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-176840ee190\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-176840ee191\">\n<div class=\"tve-cb\">\n<h4 class=\"\" id=\"t-1608531820443\">Cons of Simple Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-times-solid\" data-css=\"tve-u-176840ee194\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-176840ee195\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-176840ee197\">Simple Linkage methods are sensitive to noise and outliers.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-176840ee198\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-176840ee19a\">That means Simple Linkage methods can not group clusters properly if there is any noise between the clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 class=\"\" id=\"t-1608531820444\">Complete Linkage<\/h3>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1768412641d\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/11-Complete-Linkage-Method.png?resize=404%2C322&amp;ssl=1\" class=\"tve_image wp-image-8073\" alt=\"Complete Linkage Method\" data-id=\"8073\" width=\"404\" data-init-width=\"1024\" height=\"322\" data-init-height=\"816\" title=\"Complete Linkage Method\" loading=\"lazy\" data-width=\"404\" data-height=\"322\" data-css=\"tve-u-1768561a928\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8073\" alt=\"Complete Linkage Method\" data-id=\"8073\" width=\"404\" data-init-width=\"1024\" height=\"322\" data-init-height=\"816\" title=\"Complete Linkage Method\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/11-Complete-Linkage-Method.png?resize=404%2C322&amp;ssl=1\" data-width=\"404\" data-height=\"322\" data-css=\"tve-u-1768561a928\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">The complete Linkage method is also known as the <strong>Maximum Linkage (MAX)<\/strong> method.\u00a0<\/p>\n<p dir=\"ltr\">In the Complete Linkage technique, the distance between two clusters is defined as the maximum distance between an object (point) in one cluster and an object (point) in the other cluster.<\/p>\n<p dir=\"ltr\">And this method is also known as the furthest neighbor method.<\/p>\n<h4 class=\"\" id=\"t-1608531820445\">Pros and Cons of Complete Linkage method<\/h4>\n<\/div>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-17684137a0d\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone  \" data-css=\"tve-u-17684137cc5\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbulxqe6\" data-css=\"tve-u-17684137a0e\">\n<div class=\"tcb-flex-row v-2 tcb--cols--2\" data-css=\"tve-u-17684137a0f\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-17684137a10\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-17684137a11\">\n<div class=\"tve-cb\">\n<h4 class=\"\" id=\"t-1608531820446\">Pros of Complete Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-check\" data-css=\"tve-u-17684137a15\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684137a16\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684137a18\">Complete Linkage algorithms are less susceptible to noise and outliers.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684137a16\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684137a18\">That means the Complete Linkage method also does well in separating clusters if there is any noise between the clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-17684137a19\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-17684137a1a\">\n<div class=\"tve-cb\">\n<h4 class=\"\" id=\"t-1608531820447\">Cons of Complete Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-times-solid\" data-css=\"tve-u-17684137a1d\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684137a1e\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684137a20\">Complete linkage methods tend to break large clusters.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684137a21\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684137a23\">Complete Linkage is biased towards globular clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 class=\"\" id=\"t-1608531820448\">Average Linkage\u00a0<\/h3>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176846dbb18\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/12-Average-Linkage-Method.png?resize=404%2C348&amp;ssl=1\" class=\"tve_image wp-image-8085\" alt=\"Average Linkage Method\" data-id=\"8085\" width=\"404\" data-init-width=\"1024\" height=\"348\" data-init-height=\"881\" title=\"Average Linkage Method\" loading=\"lazy\" data-width=\"404\" data-height=\"348\" data-css=\"tve-u-176856206bd\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8085\" alt=\"Average Linkage Method\" data-id=\"8085\" width=\"404\" data-init-width=\"1024\" height=\"348\" data-init-height=\"881\" title=\"Average Linkage Method\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/12-Average-Linkage-Method.png?resize=404%2C348&amp;ssl=1\" data-width=\"404\" data-height=\"348\" data-css=\"tve-u-176856206bd\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">In the Average Linkage technique, the distance between two clusters is the average distance between each cluster\u2019s point to every point in the other cluster. <\/p>\n<p dir=\"ltr\">This method is also known as the <strong>unweighted pair<\/strong> group method with arithmetic mean.<\/p>\n<h4 id=\"t-1608531820451\" class=\"\">Pros and Cons of the Average Linkage method<\/h4>\n<\/div>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-1768416e015\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone\" data-css=\"tve-u-1768416dfad\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbulxqe6\" data-css=\"tve-u-1768416dfec\">\n<div class=\"tcb-flex-row v-2 tcb--cols--2\" data-css=\"tve-u-1768416dfee\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-1768416dfef\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-1768416dff1\">\n<div class=\"tve-cb\">\n<h4 class=\"\">Pros of Average Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-check\" data-css=\"tve-u-1768416dff6\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1768416dff7\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1768416dffa\">The average Linkage method also does well in separating clusters if there is any noise between the clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\" data-css=\"tve-u-176846f143c\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-1768416e001\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-1768416e002\">\n<div class=\"tve-cb\">\n<h4 class=\"\">Cons of Average Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-times-solid\" data-css=\"tve-u-1768416e007\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1768416e009\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1768416e00c\">The average Linkage method is biased towards globular clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 class=\"\" id=\"t-1608531820449\">Centroid Linkage\u00a0<\/h3>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1768470ff9a\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/13-Centroid-Linkage-Method.png?resize=411%2C264&amp;ssl=1\" class=\"tve_image wp-image-8091\" alt=\"Centroid Linkage Method\" data-id=\"8091\" width=\"411\" data-init-width=\"1024\" height=\"264\" data-init-height=\"657\" title=\"Centroid Linkage Method\" loading=\"lazy\" data-width=\"411\" data-height=\"264\" data-css=\"tve-u-17685623fe3\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8091\" alt=\"Centroid Linkage Method\" data-id=\"8091\" width=\"411\" data-init-width=\"1024\" height=\"264\" data-init-height=\"657\" title=\"Centroid Linkage Method\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/13-Centroid-Linkage-Method.png?resize=411%2C264&amp;ssl=1\" data-width=\"411\" data-height=\"264\" data-css=\"tve-u-17685623fe3\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">In the Centroid Linkage approach, the distance between the two sets or clusters is the distance between two mean vectors of the sets (clusters). <\/p>\n<p dir=\"ltr\">At each stage, we combine the two sets that have the <strong>smallest centroid <\/strong>distance. In simple words, it is the distance between the centroids of the two sets.<\/p>\n<h4 id=\"t-1608531820452\" class=\"\">Pros and Cons of Centroid Linkage method<\/h4>\n<\/div>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-1768417b458\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone\" data-css=\"tve-u-1768417b3ea\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbulxqe6\" data-css=\"tve-u-1768417b42e\">\n<div class=\"tcb-flex-row v-2 tcb--cols--2\" data-css=\"tve-u-1768417b430\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-1768417b432\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-1768417b434\">\n<div class=\"tve-cb\">\n<h4 class=\"\">Pros of Centroid Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-check\" data-css=\"tve-u-1768417b439\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1768417b43b\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1768417b43e\">The Centroid Linkage method also does well in separating clusters if there is any noise between the clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-1768417b445\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-1768417b446\">\n<div class=\"tve-cb\">\n<h4 class=\"\">Cons of Centroid Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-times-solid\" data-css=\"tve-u-1768417b44b\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-1768417b44d\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-1768417b450\">Similar to Complete Linkage and Average Linkage methods, the Centroid Linkage method is also biased towards globular clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 class=\"\" id=\"t-1608531820450\">Ward\u2019s Linkage\u00a0<\/h3>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1768473500e\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/14-Wards-Linkage-Method.png?resize=418%2C311&amp;ssl=1\" class=\"tve_image wp-image-8095\" alt=\"Wards Linkage Method\" data-id=\"8095\" width=\"418\" data-init-width=\"1024\" height=\"311\" data-init-height=\"761\" title=\"Wards Linkage Method\" loading=\"lazy\" data-width=\"418\" data-height=\"311\" data-css=\"tve-u-17685629d94\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8095\" alt=\"Wards Linkage Method\" data-id=\"8095\" width=\"418\" data-init-width=\"1024\" height=\"311\" data-init-height=\"761\" title=\"Wards Linkage Method\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/14-Wards-Linkage-Method.png?resize=418%2C311&amp;ssl=1\" data-width=\"418\" data-height=\"311\" data-css=\"tve-u-17685629d94\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Ward&#8217;s Linkage method is the similarity of two clusters. Which is based on the increase in squared error when two clusters are merged, and it is \u00a0similar to the group average if the distance between points is distance squared.<\/p>\n<h4 id=\"t-1608531820453\" class=\"\">Pros and Cons of Ward\u2019s Linkage method<\/h4>\n<\/div>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-176846ac28a\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone\" data-css=\"tve-u-176846ac1f5\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbulxqe6\" data-css=\"tve-u-176846ac253\">\n<div class=\"tcb-flex-row v-2 tcb--cols--2\" data-css=\"tve-u-176846ac255\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-176846ac258\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-176846ac25a\">\n<div class=\"tve-cb\">\n<h4 class=\"\">Pros of Ward&#8217;s Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-check\" data-css=\"tve-u-176846ac261\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-176846ac263\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-176846ac267\">In\u00a0many cases, Ward\u2019s Linkage is preferred as it usually produces better cluster hierarchies<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-176846ac26a\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-176846ac26e\">Ward\u2019s method is less susceptible to noise and outliers.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-176846ac270\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-176846ac272\">\n<div class=\"tve-cb\">\n<h4 class=\"\">Cons of Ward&#8217;s Linkage<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-times-solid\" data-css=\"tve-u-176846ac27a\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-176846ac27c\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-176846ac280\">Ward\u2019s linkage method is biased towards globular clusters.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Some of the other linkage methods are:<\/p>\n<ul class=\"\">\n<li>Strong Linkage<\/li>\n<li>Flexible linkage<\/li>\n<li>Simple Average<\/li>\n<\/ul>\n<p dir=\"ltr\">The Linkage method\u2019s choice depends on you, and you can apply any of them according to the type of problem, and different linkage methods lead to different clusters.<\/p>\n<p dir=\"ltr\">Below is the comparison image, which shows all the linkage methods. We took this reference image from greatlearning platform <strong><a href=\"https:\/\/www.mygreatlearning.com\/blog\/\" class=\"tve-froala\">blog<\/a>.<\/strong><\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-176847685a4\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/15-Hierarchical-Clustering-Linkages.png?resize=609%2C659&amp;ssl=1\" class=\"tve_image wp-image-8101\" alt=\"Hierarchical Clustering Linkages\" data-id=\"8101\" width=\"609\" data-init-width=\"609\" height=\"659\" data-init-height=\"659\" title=\"Hierarchical Clustering Linkages\" loading=\"lazy\" data-width=\"609\" data-height=\"659\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8101\" alt=\"Hierarchical Clustering Linkages\" data-id=\"8101\" width=\"609\" data-init-width=\"609\" height=\"659\" data-init-height=\"659\" title=\"Hierarchical Clustering Linkages\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/15-Hierarchical-Clustering-Linkages.png?resize=609%2C659&amp;ssl=1\" data-width=\"609\" data-height=\"659\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Hierarchical Clustering algorithms generate clusters that are organized into hierarchical structures. <\/p>\n<p dir=\"ltr\">These hierarchical structures can be visualized using a tree-like diagram called <strong>Dendrogram<\/strong>.\u00a0<\/p>\n<p dir=\"ltr\">Now let us discuss Dendrogram.<\/p>\n<h2 id=\"t-1608531820454\" class=\"\">What is Dendrogram\u00a0<\/h2>\n<p dir=\"ltr\">A Dendrogram is a diagram that represents the <strong>hierarchical relationship<\/strong> between objects. The Dendrogram is used to display the distance between each pair of sequentially merged objects.\u00a0<\/p>\n<p dir=\"ltr\">These are commonly used in studying hierarchical clusters before deciding the number of clusters significant to the dataset. <\/p>\n<p dir=\"ltr\">The distance at which the two clusters combine is referred to as the dendrogram distance.\u00a0<\/p>\n<p dir=\"ltr\">The primary use of a dendrogram is to work out the best way to allocate objects to clusters.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1768477c565\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/16-Hierarchical-Clustering-Dendrogram.png?resize=626%2C323&amp;ssl=1\" class=\"tve_image wp-image-8104\" alt=\"Hierarchical Clustering Dendrogram\" data-id=\"8104\" width=\"626\" data-init-width=\"1024\" height=\"323\" data-init-height=\"528\" title=\"Hierarchical Clustering Dendrogram\" loading=\"lazy\" data-width=\"626\" data-height=\"323\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8104\" alt=\"Hierarchical Clustering Dendrogram\" data-id=\"8104\" width=\"626\" data-init-width=\"1024\" height=\"323\" data-init-height=\"528\" title=\"Hierarchical Clustering Dendrogram\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/16-Hierarchical-Clustering-Dendrogram.png?resize=626%2C323&amp;ssl=1\" data-width=\"626\" data-height=\"323\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">The key point to interpreting or implementing a dendrogram is to focus on the closest objects in the dataset.\u00a0<\/p>\n<p dir=\"ltr\">Hence from the above figure, we can observe that the objects P6 and P5 are very close to each other, merging them into one cluster named C1, and followed by the object P4 is closed to the cluster C1, so combine these into a cluster (C2).\u00a0<\/p>\n<p dir=\"ltr\">And the objects P1 and P2 are close to each other so merge them into one cluster (C3), now cluster C3 is merged with the following object P0 and forms a cluster (C4), the object P3 is merged with the cluster C2, and finally the cluster C2 and C4 and merged into a single cluster (C6).\u00a0<\/p>\n<p dir=\"ltr\">Till now, we have a clear idea of the Agglomerative Hierarchical Clustering and Dendrograms.\u00a0<\/p>\n<p dir=\"ltr\">Now let us implement python code for the Agglomerative clustering technique.<\/p>\n<h2 id=\"t-1608531820455\" class=\"\">Agglomerative Clustering Algorithm Implementation in Python\u00a0<\/h2>\n<p dir=\"ltr\">Let us have a look at how to apply a hierarchical cluster in python on a <strong>Mall_Customers dataset<\/strong>.\u00a0<\/p>\n<p dir=\"ltr\">If you remembered, we have used the same dataset in the k-means clustering algorithms implementation too.\u00a0<\/p>\n<p dir=\"ltr\">Please refer to <a href=\"https:\/\/dataaspirant.com\/k-means-clustering-algorithm\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>k-means article<\/strong><\/a> for getting the dataset.<\/p>\n<h3 id=\"t-1608531820456\" class=\"\">Importing the libraries and loading the data\u00a0<\/h3>\n<p dir=\"ltr\">We are importing all the necessary libraries, then we will load the data.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17684d0e7b3\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/18-Input-data-overview.png?resize=626%2C437&amp;ssl=1\" class=\"tve_image wp-image-8110\" alt=\"Input data overview\" data-id=\"8110\" width=\"626\" data-init-width=\"1024\" height=\"437\" data-init-height=\"715\" title=\"Input data overview\" loading=\"lazy\" data-width=\"626\" data-height=\"437\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8110\" alt=\"Input data overview\" data-id=\"8110\" width=\"626\" data-init-width=\"1024\" height=\"437\" data-init-height=\"715\" title=\"Input data overview\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/18-Input-data-overview.png?resize=626%2C437&amp;ssl=1\" data-width=\"626\" data-height=\"437\" data-recalc-dims=\"1\"><\/span><\/div>\n<h3 class=\"\" id=\"t-1608531820457\">Dendrogram to find the optimal number of clusters<\/h3>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17684d8057b\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/19-dendrogram.png?resize=390%2C278&amp;ssl=1\" class=\"tve_image wp-image-8114\" alt=\"Dendrogram\" data-id=\"8114\" width=\"390\" data-init-width=\"390\" height=\"278\" data-init-height=\"278\" title=\"Dendrogram\" loading=\"lazy\" data-width=\"390\" data-height=\"278\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8114\" alt=\"Dendrogram\" data-id=\"8114\" width=\"390\" data-init-width=\"390\" height=\"278\" data-init-height=\"278\" title=\"Dendrogram\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/19-dendrogram.png?resize=390%2C278&amp;ssl=1\" data-width=\"390\" data-height=\"278\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1608531820458\" class=\"\">Training the Hierarchical Clustering model on the dataset\u00a0<\/h3>\n<p dir=\"ltr\">Now, we are training our dataset using Agglomerative Hierarchical Clustering.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17684db6485\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/20-hierarchical-clustering-result.png?resize=391%2C278&amp;ssl=1\" class=\"tve_image wp-image-8117\" alt=\"Hierarchical clustering result\" data-id=\"8117\" width=\"391\" data-init-width=\"391\" height=\"278\" data-init-height=\"278\" title=\"Hierarchical clustering result\" loading=\"lazy\" data-width=\"391\" data-height=\"278\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8117\" alt=\"Hierarchical clustering result\" data-id=\"8117\" width=\"391\" data-init-width=\"391\" height=\"278\" data-init-height=\"278\" title=\"Hierarchical clustering result\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/20-hierarchical-clustering-result.png?resize=391%2C278&amp;ssl=1\" data-width=\"391\" data-height=\"278\" data-recalc-dims=\"1\"><\/span><\/div>\n<h2 class=\"\" id=\"t-1608531820459\">Advantages and Disadvantages of Agglomerative Hierarchical Clustering Algorithm<\/h2>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-17684dc6732\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone  \" data-css=\"tve-u-17684dc6a72\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbulxqe6\" data-css=\"tve-u-17684dc6733\">\n<div class=\"tcb-flex-row v-2 tcb--cols--2\" data-css=\"tve-u-17684dc6734\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-17684dc6735\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-17684dc6736\">\n<div class=\"tve-cb\">\n<h4 class=\"\" id=\"t-1608531820460\">Advantages<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-check\" data-css=\"tve-u-17684dc673a\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684dc673b\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684dc673d\">The agglomerative technique is easy to implement.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684dc673b\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684dc673d\">It can produce an ordering of objects, which may be informative for the display.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684dc673b\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684dc673d\">In agglomerative Clustering, there is no need to pre-specify the number of clusters.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684dc673b\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684dc673d\">By the Agglomerative Clustering approach, smaller clusters will be created, which may discover similarities in data.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbulxl9a\" data-css=\"tve-u-17684dc673e\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbulxc3q\" data-css=\"tve-u-17684dc673f\">\n<div class=\"tve-cb\">\n<h4 class=\"\" id=\"t-1608531820461\">Disadvantages<\/h4>\n<div class=\"thrv_wrapper thrv-styled_list dynamic-group-kbulx7a0\" data-icon-code=\"icon-times-solid\" data-css=\"tve-u-17684dc6742\">\n<ul class=\"tcb-styled-list\">\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684dc6743\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684dc6745\">The agglomerative technique gives the best result in some cases only.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684dc6746\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684dc6748\">The algorithm can never undo what was done previously, which means if the objects may have been incorrectly grouped at an earlier stage, and the same result should be close to ensure it.<\/span><\/li>\n<li class=\"thrv-styled-list-item dynamic-group-kbulwyg8\" data-css=\"tve-u-17684dc6749\"><span class=\"thrv-advanced-inline-text tve_editable tcb-styled-list-icon-text tcb-no-delete tcb-no-save dynamic-group-kbulwoj9\" data-css=\"tve-u-17684dc674b\">The usage of various distance metrics for measuring distances between the clusters may produce different results. So performing multiple experiments and then comparing the result is recommended to help the actual results\u2019 veracity.<\/span><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2 class=\"\" id=\"t-1608531820462\">Divisive Hierarchical Clustering<\/h2>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17684e1d5ff\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/17-Hierarchical-Divisive-Clustering.png?resize=534%2C397&amp;ssl=1\" class=\"tve_image wp-image-8128\" alt=\"Hierarchical Divisive Clustering\" data-id=\"8128\" width=\"534\" data-init-width=\"1024\" height=\"397\" data-init-height=\"761\" title=\"Hierarchical Divisive Clustering\" loading=\"lazy\" data-width=\"534\" data-height=\"397\" data-css=\"tve-u-17685636a44\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-8128\" alt=\"Hierarchical Divisive Clustering\" data-id=\"8128\" width=\"534\" data-init-width=\"1024\" height=\"397\" data-init-height=\"761\" title=\"Hierarchical Divisive Clustering\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/17-Hierarchical-Divisive-Clustering.png?resize=534%2C397&amp;ssl=1\" data-width=\"534\" data-height=\"397\" data-css=\"tve-u-17685636a44\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Divisive Hierarchical Clustering is also known as <strong>DIANA<\/strong> (Divisive Clustering Analysis.) <\/p>\n<p dir=\"ltr\">It is a top-down clustering approach. It works as similar as Agglomerative Clustering but in the <strong>opposite<\/strong> direction.\u00a0<\/p>\n<p dir=\"ltr\">This approach starts with a single cluster containing all objects and then splits the cluster into two least similar clusters based on their characteristics. We proceed with the same process until there is one cluster for each observation.\u00a0<\/p>\n<p dir=\"ltr\">Here, the divisive approach method is known as rigid, i.e., once a splitting is done on clusters, we can&#8217;t revert it.<\/p>\n<h3 id=\"t-1608531820463\" class=\"\">Steps to perform Divisive Clustering\u00a0<\/h3>\n<ul class=\"\">\n<li>Initially, all the objects or points in the dataset belong to one single cluster.<\/li>\n<li>Partition the single cluster into two least similar clusters.<\/li>\n<li>And continue this process to form the new clusters until the desired number of clusters means one cluster for each observation.<\/li>\n<\/ul>\n<h2 id=\"t-1608531820464\" class=\"\">Strengths and Limitations of Hierarchical Clustering Algorithm<\/h2>\n<p dir=\"ltr\">For every algorithm, we do have strengths and limitations. If we don&#8217;t know about these, we end up using these algorithms in the cases where they are limited not to use. So let\u2019s learn this as well.<\/p>\n<h3 id=\"t-1608531820465\" class=\"\">Strengths of Hierarchical Clustering\u00a0<\/h3>\n<ul class=\"\">\n<li>It is to understand and implement.<\/li>\n<li>We don\u2019t have to pre-specify any particular number of clusters.\n<ul>\n<li>Can obtain any desired number of clusters by cutting the Dendrogram at the proper level.<\/li>\n<\/ul>\n<\/li>\n<li>They may correspond to meaningful classification.<\/li>\n<li>Easy to decide the number of clusters by merely looking at the Dendrogram.<\/li>\n<\/ul>\n<h3 id=\"t-1608531820466\" class=\"\">Limitations of Hierarchical Clustering<\/h3>\n<ul class=\"\">\n<li>Hierarchical Clustering does not work well on vast amounts of data.<\/li>\n<li>All the approaches to calculate the similarity between clusters have their own disadvantages.<\/li>\n<li>In hierarchical Clustering, once a decision is made to combine two clusters, it can not be undone.<\/li>\n<li>Different measures have problems with one or more of the following.\n<ul>\n<li>Sensitivity to noise and outliers.<\/li>\n<li>Faces Difficulty when handling with different sizes of clusters.<\/li>\n<li>It is breaking large clusters.<\/li>\n<li>In this technique, the order of the data has an impact on the final results.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 class=\"\" id=\"t-1608531820467\">Conclusion<\/h2>\n<p dir=\"ltr\">In this article, we discussed the hierarchical cluster algorithm\u2019s in-depth intuition and approaches, such as the Agglomerative Clustering and Divisive Clustering approach. <\/p>\n<p dir=\"ltr\">Hierarchical Clustering is often used in the form of descriptive rather than predictive modeling.<\/p>\n<p dir=\"ltr\">Mostly we use Hierarchical Clustering when the application requires a hierarchy. The advantage of Hierarchical Clustering is we don\u2019t have to pre-specify the clusters.\u00a0<\/p>\n<p dir=\"ltr\">However, it doesn\u2019t work very well on vast amounts of data or huge datasets. And there are some disadvantages of the Hierarchical Clustering algorithm that it is not suitable for large datasets. And it gives the best results in some cases only.<\/p>\n<\/div>\n<h4 class=\"\">Recommended Courses<\/h4>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-17683f8588c\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone  \" data-css=\"tve-u-176853f16d0\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbt3q0q7\" data-css=\"tve-u-17481b95e2b\">\n<div class=\"tcb-flex-row v-2 tcb--cols--3 tcb-medium-no-wrap tcb-mobile-wrap m-edit\" data-css=\"tve-u-17683f8588d\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17683f858a4\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17683f858a7\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/clustering_unsupervised_learning.jpg?resize=176%2C176&amp;ssl=1\" class=\"tve_image wp-image-7846\" alt=\"clustering unsupervised learning\" data-id=\"7846\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"clustering unsupervised learning\" loading=\"lazy\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17683f858a8\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7846\" alt=\"clustering unsupervised learning\" data-id=\"7846\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"clustering unsupervised learning\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/clustering_unsupervised_learning.jpg?resize=176%2C176&amp;ssl=1\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17683f858a8\" data-recalc-dims=\"1\"><span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17683f8588f\">Cluster Analysis With Python<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17683f858a5\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17683f858b3\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/unsupervised_learning.jpg?resize=176%2C176&amp;ssl=1\" class=\"tve_image wp-image-7848\" alt=\"unsupervised learning\" data-id=\"7848\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"unsupervised learning\" loading=\"lazy\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17683f858b4\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-7848\" alt=\"unsupervised learning\" data-id=\"7848\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"unsupervised learning\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/12\/unsupervised_learning.jpg?resize=176%2C176&amp;ssl=1\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17683f858b4\" data-recalc-dims=\"1\"><span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17683f85896\">Unsupervised Learning Algorithms<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17683f858a6\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17683f858b5\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/tcb_content_templates\/\/images\/mega_menu_img_06-e1592987561232.jpg?resize=176%2C176\" class=\"tve_image wp-image-60932\" alt data-id=\"60932\" width=\"176\" data-init-width=\"400\" height=\"176\" data-init-height=\"400\" title=\"mega_menu_img_06\" loading=\"lazy\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17683f858b6\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-60932\" alt=\"\" data-id=\"60932\" width=\"176\" data-init-width=\"400\" height=\"176\" data-init-height=\"400\" title=\"mega_menu_img_06\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/tcb_content_templates\/\/images\/mega_menu_img_06-e1592987561232.jpg?resize=176%2C176\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17683f858b6\" data-recalc-dims=\"1\"><span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17683f8589e\">A to Z Machine Learning with Python<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/dataaspirant.com\/hierarchical-clustering-algorithm\/<\/p>\n","protected":false},"author":0,"featured_media":8012,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8011"}],"collection":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/comments?post=8011"}],"version-history":[{"count":0,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/8011\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media\/8012"}],"wp:attachment":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media?parent=8011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/categories?post=8011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/tags?post=8011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}