Clustering

Split observations into groups so similar points share a cluster — no labels required.

Unlike classification, nobody hands you the group names. You invent a partition that puts similar points together and different points apart. Centroid-based methods represent each cluster by a centre $z_j$ and assign point $i$ to cluster $c_i$.

$$L=\sum_{i=1}^{N}\|x_i-z_{c_i}\|^2$$

Assignments and centres depend on each other — that coupling is why we need an alternating algorithm like k-means.

Supermarket customers

Each customer is a vector of purchase habits. Clustering finds groups (bargain hunters, organic buyers, …) for targeted marketing — without any pre-labelled “type”. Quality is judged by within-cluster compactness and domain usefulness.

Key takeaways

  • Unsupervised grouping.
  • Centroid = prototype of a cluster.
  • Loss = how far points sit from their centre.