This article was automatically translated from the original Turkish version.
+1 More
K-Means Clustering Algorithm is a center-based, iterative machine learning algorithm that partitions unlabeled (unsupervised) data points into K clusters based on their similarity. Each data point belongs to exactly one cluster; in this regard, it is a "hard" clustering technique. Unlike supervised learning, the K-Means algorithm does not require class labels and aims to discover the natural structure within the data.
The K-Means algorithm forms clusters around a predefined number of centroids. Each data point is assigned to the nearest centroid. The cluster centers are then updated by computing the mean of all data points assigned to each cluster. This process continues until the centroids stabilize (convergence) or a maximum number of iterations is reached.
K-Means seeks to minimize the total sum of squared errors (SSE), which is the sum of the squared distances between each data point and the centroid of its assigned cluster:
SSE =
Where:

K-Means Algorithm Illustration (generated by artificial intelligence.)
Erdoğmuş, Pakize, Buket Çolak, and Zehra Durdağ. "K-Means algoritması ile otomatik kümeleme." El-Cezeri 3, no. 2 (2016). Accessed Adresi.
MathWorks. "kmeans." MATLAB Documentation. Accessed June 22, 2025. Accessed Adresi.
Piech, Chris. "K-means Clustering." Stanford University. Accessed June 22, 2025. Accessed Adresi.
No Discussion Added Yet
Start discussion for "K-Means Clustering Algorithm" article
Basic Working Principle
Algorithm Steps
Mathematical Objective
Advantages
Disadvantages
Optimization Methods
1. Determining the Number of Clusters
2. Selecting Initial Centroids
Cluster Quality Metrics
Applications
Alternatives and Enhancements