K-Means Clustering

xsabzal

Abzal Seitkaziyev

Posted on March 8, 2021

K-Means Clustering

K-Means clustering is unsupervised algorithm, which is very intuitive and could be visualized geometrically.
Basically, we are trying to split the data into the k groups or clusters, and each cluster has a center, which is defined by calculating geometrical centroid of the cluster.

Steps of the K-means clustering algorithm:

1) Set k initial centers randomly
Alt Text
2) Calculate 'distances'(e.g., if in 2d space) from the data point to these centers and group the data by the 'closest' distances to these centers
Alt Text
3) Recalculate position of k centers (as a mean of the data in that cluster)
Alt Text
4) repeat steps 2 and 3 until no changes.
Alt Text
Alt Text

Here is the link I used to play and visualize clustering.

💖 💪 🙅 🚩
xsabzal
Abzal Seitkaziyev

Posted on March 8, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related