How does clustering differ from classification?
Last updated
Classification is supervised: it learns a mapping to predefined labels from labeled examples. Clustering is unsupervised: it discovers groups in unlabeled data based on similarity, with no ground truth defining the groups.
Data and goal:
Classification needs (x, y) pairs and predicts y for new x.
Clustering only sees x and finds structure. The clusters have no names until a human interprets them.
Number of groups:
In classification, the classes are fixed by the labels.
In clustering, the number of groups must be chosen (k in k-means) or inferred (DBSCAN, HDBSCAN).
Evaluation:
Classification uses accuracy, F1, or AUC against true labels.
Clustering uses internal metrics (silhouette, Davies–Bouldin), external metrics when labels exist (ARI, NMI), or business usefulness.
They are often combined:
Cluster first, then label the clusters and train a classifier on them.
Cluster IDs can also serve as features for a supervised model.