K-Means clustering is an unsupervised learning algorithm that groups unlabeled data points into K number of clusters based on their similarity. It works by first randomly selecting K cluster centers, known as centroids. It then assigns each data point to the closest centroid, forming K clusters. It then recalculates the position of the centroids and reassigns data points in an iterative process, until the centroids are stable or the maximum number of iterations is reached. The optimal number of clusters K is determined using the elbow method by plotting the within-cluster sum of squares (WCSS) against the number of clusters K.
Related topics: