ML Case Labs — Validation, Boosting, Segmentation, Pipelines
Back to M3 — Clustering + Pipelines/SHAP

k-Means / DBSCAN / Hierarchical Lab

Outcome: cluster + justify k via silhouette/elbow. Curated video (8:30, verified 2026-09-24 via yt-dlp): StatQuest: K-means clustering (StatQuest with Josh Starmer) Watch: https://www.youtube.com/watch?v=4b5d3muPQmA Notes: K-means algorithm walkthrough; elbow plot for picking K; K-means vs hierarchical contrast. Lab: cluster the segmentation set, justify K via elbow (pair with silhouette in the notebook). Key moments: 0:00 Intro; 0:33 K-means algorithm; 4:26 Elbow plot for K; 6:06 K-means vs hierarchical; 6:28 2-D example; 7:08 Heatmaps.

8 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Lab Overview and Setup — Outlines the unlabeled customer segmentation objectives and feature preprocessing steps.
  2. k-Means and Elbow Analysis — Demonstrates fitting k-Means models across k values and plotting inertia elbows.
  3. Silhouette Validation — Calculates silhouette coefficients to mathematically justify the final cluster count.
  4. DBSCAN Density Clustering — Applies DBSCAN to detect non-spherical groupings and isolate anomalous noise points.
  5. Hierarchical Dendrogram Cuts — Constructs linkage matrices and cuts dendrograms to validate structural cluster groupings.
  6. Model Comparison and Summary — Summarizes trade-offs between geometric, density, and hierarchical clustering pipelines.
PDF notes

Frequently asked questions

What should I do if the inertia elbow plot has no distinct sharp bend?

Evaluate the silhouette score across candidates and inspect cluster sizes to select the k with optimal separation and interpretability.

Why does DBSCAN assign label -1 to some data points?

Label -1 denotes noise points that lack sufficient neighboring points within the epsilon radius and are not reachable from core points.

Which linkage metric should I default to for Agglomerative Clustering?

Ward linkage is the standard default because it minimizes within-cluster variance and tends to produce balanced, cohesive clusters.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.