How does clustering differ from classification?

Last updated 11 November 2026

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.

  • https://www.geeksforgeeks.org/machine-learning/ml-classification-vs-clustering/
  • https://www.geeksforgeeks.org/interview-experiences/top-50-data-mining-interview-questions-answers/
  • https://www.interviewbit.com/machine-learning-interview-questions/
All Clustering interview questions