K-means clustering

K-means is the most popular of the clustering techniques because of its ease of use and implementation. It also has a partner by the name of K-medoid. These partitioning methods create level-one partitioning of the dataset. Let's discuss K-means in detail.

K-means algorithm

K-means start with a prototype. It takes centroids of data points from the dataset. This technique is used for the objects lying in the n-dimensional space.

The technique involves choosing the K number of centroids. This K is specified by the user and is chosen considering various factors. It defines how many clusters we want. So, choosing a higher or lower than the required K can lead to undesired results.

Now going forward, each point is assigned to its nearest ...

Get Julia for Data Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.