# Hierarchical clustering

* To make clusters within clusters.
    
* Each data point belongs to many clusters.
    
* Time-consuming and resource intensive.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1688620592901/d5d1bd6f-9157-4e15-bb15-237d4a70cf22.jpeg align="center")

### Finding the distance between 2 clusters:-

Clusters = {C1, C2}

1. Max distance = max {d(x, y)} where x belongs to C1 and y belongs to C2
    
2. Min distance = min {d(x, y)} where x belongs to C1 and y belongs to C2
    
3. Average distance = avg {d(x, y)} where x belongs to C1 and y belongs to C2
    

Building hierarchical cluster methods:-

1. Top-down approach -
    
    * All observations start in one cluster, and splits are performed recursively as one moves down the hierarchy.
        
    * Also known as the divisive approach.
        
    * ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1688621762752/eb5bdf49-76e4-4d8e-87b6-91103b674455.jpeg align="center")
        
    
2. Bottom-up approach -
    
    * Each observation starts in its own cluster, and pairs of clusters are merged as one moves up the hierarchy.
        
    * Also known as the agglomerative approach.
        
    * ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1688622492407/ea286591-ab3c-4ae9-b0f0-6d9889fced40.jpeg align="center")
