The key concepts of k-means and DBSCAN clustering
With k-means clustering, we identify k clusters, each with a center, or centroid. The centroid is the point that minimizes the total squared distance between it and the other data points in the cluster.
An example with made-up data should help here. The data points in Figure 16.1 seem to be in three clusters. (It is not usually that easy to visualize the number of clusters, k.)
We perform the following steps to construct the clusters:
- Assign a random point as the center of each cluster.
- Calculate the distance of each point from the center of each cluster.
- Assign data points to a cluster based on their proximity to the center point. These first three steps are illustrated in Figure 16.2. The points with an X are the randomly chosen cluster centers (with k set at 3). Data points that are closer to the cluster center point than...