Exam SRM · Unsupervised Learning Techniques · Free Lesson

Choosing the Number of Clusters

Free SOA Exam SRM (Statistics for Risk Modeling) lesson in Unsupervised Learning Techniques. 12 min read, ~1,797 words.

K-means demands you specify k before running; hierarchical clustering produces every k from 1 to n. Either way, the modeler must defend the choice.

Define the total within-cluster sum of squares.

The inner sum runs over every ordered pair in , so each unordered pair is counted twice, and the 2 in the denominator cancels that double count. The pairwise form is slow to evaluate, so compute the same number from the centroids instead:

Check both routes on the cluster , whose centroid is 5. Centroid route: . Pairwise route: the three unordered pairs contribute , which doubles to 156 over ordered pairs, and .

TRAP: Two names, two scales. An Introduction to Statistical Learning (ISLR) calls the within-cluster variation of cluster c, with no 2 in the denominator, and equation 12.18 shows that...

Read the full lesson, free →
Worked examples and practice. Free with a free account, no card.

Common mistakes

Bottom line

Exam shortcut

If a prompt gives W(k) values, compute successive drops and locate where the ratio of consecutive drops collapses; that is the elbow. If it gives silhouette averages, pick the maximum unless a higher-k value is within rounding distance of the leader. If it mentions an expected log W or a reference distribution, you are in gap-statistic territory and the answer rule is "smallest k with Gap(k) ≥ Gap(k+1) − ."

The full lesson (about 1,797 words, 12 min read) adds 2 worked examples, all 6 common mistakes, a self-check, free in the app.

Learning objectives

Browse all free Exam SRM lessons or jump into free Exam SRM practice questions.