A4.3.4 Describe how clustering techniques in unsupervised learning are used to group data based on similarities in features.  (HL only)

A4.3.4 Describe how clustering techniques in unsupervised learning are used to group data based on similarities in features. 
• Clustering techniques in unsupervised learning group data based on feature similarities 
• Real-world applications of clustering may include using purchasing data to segment a customer base

The Big Idea

Clustering is an unsupervised machine learning technique that automatically groups data points into clusters based on how similar they are in terms of their features—without any labeled output. Unlike supervised learning, where the model learns from examples with known outcomes, clustering algorithms discover structure in the data on their own, revealing hidden patterns and relationships.

Clustering is especially valuable when the goal is to explore data, segment populations, or detect patterns without predefined categories.


How Clustering Works

Clustering algorithms operate by calculating some measure of similarity or distance between data points—most commonly Euclidean distance—and grouping points that are close to one another in the feature space.

Each data point is represented as a vector of features, and the algorithm tries to minimize intra-cluster distance (points within a group are similar) and maximize inter-cluster distance (points between groups are dissimilar).


Common Clustering Techniques

1. K-Means Clustering

  • One of the most widely used algorithms.
  • Divides data into k clusters, where each point belongs to the cluster with the nearest mean (centroid).
  • Iteratively updates centroids to minimize variance within clusters.

Requires the user to choose the value of k beforehand.

2. Hierarchical Clustering

  • Builds a tree (dendrogram) of clusters by either:
    • Agglomerative approach: start with individual points and merge them.
    • Divisive approach: start with one cluster and split it.
  • Does not require a predefined number of clusters.

3. DBSCAN (Density-Based Spatial Clustering of Applications with Noise)

  • Groups points that are closely packed and marks points in sparse regions as outliers.
  • Can identify clusters of arbitrary shape.
  • Does not require specifying the number of clusters.

Real-World Application: Customer Segmentation

Scenario:

A retail company wants to segment its customer base to personalize marketing strategies.

  • Input features: frequency of purchases, total spending, product categories, time of purchase.
  • Clustering groups customers into segments such as:
    • High spenders who shop infrequently
    • Bargain shoppers who buy during sales
    • Loyal weekly shoppers with moderate spending

This information can be used to:

  • Send customized promotions
  • Recommend products based on cluster behavior
  • Allocate resources for customer service

This is widely used in e-commerce, loyalty programs, and subscription services like Spotify or Netflix.


Student-Relatable Example

Imagine your school collects data about student interests for organizing after-school activities. Each student lists their interests: coding, music, art, sports, etc.

  • A clustering algorithm like K-Means could group students with similar interest patterns into clusters—without knowing their specific club memberships.
  • One group might contain students interested in both music and art; another might cluster those who like sports and technology.
  • This enables the school to propose new clubs or interdisciplinary events based on actual student preferences—even if no one explicitly asked for them.

Summary

Clustering is a powerful unsupervised learning method for discovering structure in data by grouping similar items together. By analyzing feature similarity, clustering helps uncover patterns in data where labels are unavailable or unknown. Whether used for customer segmentation, document grouping, or student interest analysis, clustering provides insights that drive informed decisions and personalized experiences.