How we measure the distance between two clusters?

As we have seen, the closest distance between the two clusters is crucial for the hierarchical clustering. There are various ways to calculate the distance between two clusters, and these ways decide the rule for clustering. These measures are called Linkage methods . Some of the popular linkage methods are given below:

  1. Single Linkage: It is the Shortest Distance between the closest points of the clusters. Consider the below image:
    Hierarchical Clustering in Machine Learning
  2. Complete Linkage: It is the farthest distance between the two points of two different clusters. It is one of the popular linkage methods as it forms tighter clusters than single-linkage.
    Hierarchical Clustering in Machine Learning
  3. Average Linkage: It is the linkage method in which the distance between each pair of datasets is added up and then divided by the total number of datasets to calculate the average distance between two clusters. It is also one of the most popular linkage methods.
  4. Centroid Linkage: It is the linkage method in which the distance between the centroid of the clusters is calculated. Consider the below image:
    Hierarchical Clustering in Machine Learning

From the above-given approaches, we can apply any of them according to the type of problem or business requirement.