In this section, you will learn about how the k-means algorithm works under the hood, in order to cluster data into groups that make logical sense.
Let's consider a set of points, as illustrated in the following diagram:
A random set of points
In this section, you will learn about how the k-means algorithm works under the hood, in order to cluster data into groups that make logical sense.
Let's consider a set of points, as illustrated in the following diagram:
The first step that the algorithm takes is to assign a set of random centroids. Assuming that we want to find two distinct clusters or groups, the algorithm can assign two centroids, as shown in the following diagram:
In the preceding diagram, the stars represent the centroids of the algorithm. Note that in this case, the clusters' centers perfectly fit the two distinct groups. This is the most...