Skip to main content
Module 9 · Lesson 2 of 542/56 in the course~20 min
Module lessons (2/5)

Choosing k: elbow and silhouette

Lesson preview5 hands-on exercises readyMachine Learning: from first principles to practice · Module 9 — Unsupervised learning

The elbow method, inertia curves, the silhouette score and diagnosing clusters.

What you'll learn in this lesson

  • Explain why inertia alone cannot determine the best number of clusters.
  • Apply the elbow method to detect points of diminishing returns.
  • Compute and interpret the silhouette score with scikit-learn.

Overview

When training a supervised classifier, cross-validation tells you when model complexity starts to hurt test accuracy. But with unsupervised clustering, there are no test labels to score against.

As you increase k, inertia drops continuously until k = N, where inertia equals zero. To pick a meaningful k, we rely on structural criteria that balance tight clusters against simplicity:

Sections covered in this lesson

  1. 1The dilemma of choosing k
  2. 2Try it: interactive elbow & silhouette chooser
  3. 3The elbow & silhouette methods
  4. 4Progressive examples: inertia curves and silhouette sweeps
  5. 5Practice
  6. 6Check your understanding
Pro Lesson · Module 9 — Unsupervised learning

Unlock "Choosing k: elbow and silhouette" and the full Machine Learning: from first principles to practice curriculum

The elbow method, inertia curves, the silhouette score and diagnosing clusters.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.