Clustering Algorithms a brief
K-means clustering is a method of cluster analysis which aims to partition
n observations into k clusters in which each observation belongs to the cluster with the nearest mean. K-means clustering can be described as a partitioning method. Unlike the hierarchical clustering methods, k-means does not create a tree structure to describe the groupings in your data, but rather creates a single level of clusters. K-means uses an iterative algorithm that minimizes the sum of distances from each object to its cluster centroid, over all clusters. This algorithm moves objects between clusters until the sum cannot be decreased further. The result is a set of clusters that are as compact and well-separated as possible.
Hierarchical Clustering Algorithm
Hierarchical clustering is often portrayed as the better quality clustering approach, but is limited because of its quadratic time complexity. Its quality may be observed if an appropriate distance metric can be defined
to obtain the similarity, in this case a distance matrix. From this point of view, hierarchical clustering is the ideal method of clustering, but has not been preferred much due to other complexities.