The k-means algorithm is one of the most popular clustering algorithms. This algorithm is used to divide the input data into k subgroups using various attributes of the data. Grouping is achieved using an optimization technique where we try to minimize the sum of squares of distances between the datapoints and the corresponding centroid of the cluster.
Clustering data using the k-means algorithm
Getting ready
In this recipe, we will use the k-means algorithm to group the data into four clusters identified by the relative centroid. We will also be able to trace the boundaries to identify the areas of relevance of each cluster.