K-means
K-means is a popular clustering algorithm used in data analysis to group similar data points together. It works by dividing a dataset into a specified number of clusters, represented by their centroids. The algorithm iteratively assigns each data point to the nearest centroid and then recalculates the centroids based on the assigned points until the clusters stabilize.
The process begins with randomly selecting K centroids, where K is the number of desired clusters. After assigning points to the nearest centroid, the centroids are updated by calculating the mean of the points in each cluster. This continues until the assignments no longer change significantly.