What is K-means clustering?
K-means is one of the most popular clustering algorithms in machine learning. It automatically groups similar data points into clusters by finding the centers of these groups.
How the algorithm works:
- 1. Randomly place K cluster centers
- 2. Assign each point to the nearest center
- 3. Update cluster centers as the mean of all points in the cluster
- 4. Repeat steps 2-3 until convergence
Usage:
- • Customer segmentation
- • Image analysis
- • Grouping documents
- • Anomaly detection
3
150
5
Visualization of clustering
Statistics
Iteration:
0
Within-cluster distance:
0.00
Inter-cluster distance:
0.00
Wind shape coefficient:
0.00
Status:
'Ready'
Convergence graph
Frequently asked questions
Use the elbow method, silhouette analysis, or information criteria (AIC, BIC).
Due to random initialization of centroids. Solution: run the algorithm several times with different initial centroids.
Sensitive to outliers, works only with numerical data, assumes spherical clusters of uniform size.
Silhouette coefficient, Calinski-Harabasz index, or external metrics if there are reference classes.
Yes, after text vectorization (TF-IDF, Word2Vec, BERT embeddings).