DWDMData Warehousing & Mining
Unit V ยท 9 Lectures

Finding Groups Without Labels

Clustering discovers natural groupings in unlabelled data. Run k-means step by step, build a dendrogram by merging, weigh the trade-offs and spot outliers โ€” then test yourself with 10 questions.

Course IT314 B
Unit V
Type Unsupervised
Outcome CO3

What you'll master

INTERACTIVE
0
Method families
0
Live k-means
0
Concept videos
0
Quiz questions
01

What Is Clustering?

Group by similarity

Clustering puts similar objects in the same group and dissimilar ones apart โ€” with no labels to learn from. Good clusters have high intra-cluster similarity and low inter-cluster similarity. It's unsupervised: the structure is discovered, not taught.

Families of methods

  • Partitioning โ€” split into k groups (k-means, k-medoids).
  • Hierarchical โ€” build a tree of clusters (agglomerative / divisive).
  • Density-based โ€” grow clusters from dense regions (DBSCAN).
  • Grid / model-based โ€” partition space or fit distributions.
02

k-means, Step by Step

k-means repeats two steps until nothing moves: assign each point to its nearest centroid, then update each centroid to the mean of its points. Press Step to watch one round, Run to animate to convergence, and change k or resample the data.

k-means clusteringStep = one assign+update round
k โ€” number of clusters3
Iteration
0
Status
ready
Watch it converge: centroids (the large rings) drift toward the centre of their points each Step, and the colours settle. k-means always converges, but the result depends on the random start and on choosing the right k โ€” the classic limitations of partitioning.
03

Hierarchical Clustering

Agglomerative (bottom-up)

Start with every point as its own cluster, then repeatedly merge the two closest clusters until one remains. The merge order draws a dendrogram; cut it at a height to get any number of clusters.

Linkage = how cluster distance is measured: single (nearest pair), complete (farthest pair), average, or Ward (variance).

Divisive (top-down)

The opposite: start with all points in one cluster and recursively split. It's more expensive but can capture large structure first. Both produce a hierarchy โ€” no need to pre-choose k.

Dendrogram

A tree showing the merge/split order and the distance at each join.

Key issue: linkage

Single linkage can "chain"; complete linkage makes compact clusters.

Strength

No need to fix k in advance; produces a full hierarchy and interpretable tree.

Weakness

Costly (O(nยฒ) or worse) and merges/splits are irreversible โ€” a bad early step stays.

04

Trade-offs & Outliers

Choosing k

Use the elbow method (within-cluster sum of squares) or silhouette score to pick a sensible k for k-means.

k-means strengths

Simple, fast and scalable โ€” great for large, roughly spherical clusters.

k-means weaknesses

Needs k up front, sensitive to initial centroids and outliers, and assumes convex, similar-sized clusters.

Outlier detection

Points far from any cluster centre (or in very low-density regions) are flagged as outliers โ€” useful for fraud and fault detection.

k-medoids

Uses actual data points as centres, making it more robust to outliers than k-means.

Distance measures

Euclidean, Manhattan or cosine โ€” the choice of similarity shapes the clusters found.

05

Watch the Concepts

Two clear explainers from StatQuest with Josh Starmer on the two clustering families in this unit.

StatQuestK-means ClusteringAssign, update, repeat โ€” and how to pick k.
StatQuestHierarchical ClusteringMerging clusters and reading a dendrogram.

Videos are embedded from YouTube and belong to their creators. If a frame is blank, your network may block YouTube.

06

Unit V Quiz โ€” 10 Questions

Test yourself: Clustering0 / 10