dendrogram(linkedorientation='top',labels=labellistdistance_sort='descending',show_leaf_counts=trueplt show(nowonce the big cluster is formedthe longest vertical distance is selected vertical line is then drawn through it as shown in the following diagram as the horizontal line crosses the blue line at two pointsthe number of clusters would be two nextwe need to import the class for clustering and call its fit_predict method to predict the cluster we are importing agglomerativeclustering class of sklearn cluster library