Unsupervised learning algorithm K-Means clustering Unlike supervised learning, there is no labelled data for this grouping. K-Means divides things into clusters based on their similarities and differences with objects in other groups.
They are frequently confused with one another. The 'K' in the K-Means Clustering algorithm is not the same as the 'K' in the KNN algorithm. KNN is a supervised learning method for classification, whereas k-Means Clustering is an unsupervised learning approach for clustering.
The number of clusters into which you want to divide your data points, i.e. the value of K, must be pre-determined in k-means clustering, whereas data is automatically organised into a tree shape form in hierarchical clustering (dendrogram).