What a cluster is
Every model so far, from nearest neighbours to the deep networks of the topic Training deep networks, learned from pairs : an object and the answer it should get. The answers are the expensive part of a dataset. Someone has to mark each email as spam, check each loan, label each image. Often there are no labels at all: a log of customer sessions, a million unannotated photos, the vectors a network's hidden layer produces.
The data still have structure. The first question to ask of them is whether they fall into groups. That is clustering: split the points into groups so that points in a group are similar and points in different groups are not.
The sentence leaves two choices open: what "similar" means and what shape a group may have. Three common answers:
- Compact groups. A cluster is a ball around a centre; points are close to their centre. This is k-means.
- Dense regions. A cluster is a crowded region of any shape, separated by sparse space; isolated points belong to no cluster. This is DBSCAN.
- Connected structure. A cluster is a set of points linked by chains of near neighbours. This is single linkage and spectral clustering.
On well-separated round blobs all three agree. Elsewhere they disagree, and none of them is wrong: they answer different questions. Kleinberg (2002) proved there is no way around this choice. No clustering rule built on pairwise distances can have three natural properties at once: ignore the unit of distance, be able to output any partition, and keep its answer when clusters are made tighter and further apart.
The distance itself is part of the answer. Every method in this topic sees the data only through distances, so the units of the features matter. As in the topic Nearest neighbours, a feature on a large scale dominates every distance. On four well-separated blobs, k-means recovers the blobs exactly; after one feature is multiplied by 10, it recovers them only partly. Scaling and encoding from the topic Data, features and leakage are part of the clustering.
Notation for the whole topic: points , the number of clusters (capital, so it is not confused with neighbours), the cluster of point , the set of points in cluster and its size .