Back to the 2024 paper

Module 3: Classification and Prediction

20247m

Explain the difference between classification and clustering. Provide examples where each technique would be more appropriate.

Worked SolutionAI Assisted

Classification vs Clustering

Definitions. Classification is supervised learning: given a set of records already labelled with predefined classes, it builds a model that predicts the class of unseen records. Clustering is unsupervised learning: it groups records into clusters so that objects within a cluster are similar to each other and dissimilar to those in other clusters, with no labels available.

1. Key differences

Criterion Classification Clustering
Learning type Supervised Unsupervised
Input data Training set with class labels Unlabelled data
Goal Predict the class of new objects Discover natural groupings in the data
Output A classifier (decision tree, rules, network) A partition, hierarchy or density-based groups
Evaluation Accuracy, precision, recall, F1, ROC Internal: silhouette, purity, within-cluster SSE; external: Rand index
Predefined classes? Yes, fixed in advance No, number and meaning of clusters emerge from data
Feedback Errors correct the model (backpropagation, pruning) No notion of error, only an objective to optimise
Typical algorithms Decision trees, Naive Bayes, KNN, SVM, neural networks k-means, hierarchical, DBSCAN, Gaussian mixtures
Cost of labelling Requires expensive labelled examples Needs no labels

2. Where each is more appropriate

Classification suits problems where the categories are already known and the objective is prediction:

  • Spam detection: classify email as spam or not spam from labelled messages.
  • Credit approval: predict good/bad payers from historical applications.
  • Disease diagnosis: assign a patient to a diagnosis from symptoms and test results.
  • Customer churn: predict which subscriber will cancel, so the model must generalise to future customers.

Clustering suits problems where the categories are unknown or must be discovered:

  • Customer segmentation: group buyers by purchase behaviour before designing targeted campaigns.
  • Document grouping: organise news articles or research papers into topics with no prior taxonomy.
  • Image segmentation: partition an image into homogeneous regions by pixel colour and texture.
  • Anomaly/fraud detection: points that do not belong to any dense cluster are flagged as outliers.
  • Exploratory analysis: first-pass structure discovery when labels do not exist at all.

3. How they relate

Clustering can feed classification: clusters may be labelled after inspection and used as classes, or cluster indices added as new features. Conversely, classification with labelled data can validate clusters (external validation). Between the two lie semi-supervised methods that exploit a small number of labels together with unlabelled data.

Conclusion: the deciding question is do the class labels already exist? If yes and prediction on new cases matters, classify; if no and the aim is to uncover structure, cluster.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.