Exam SRM · Unsupervised Learning Techniques · Free Lesson

K-Means and Hierarchical Clustering

Free SOA Exam SRM (Statistics for Risk Modeling) lesson in Unsupervised Learning Techniques. 24 min read, ~3,670 words.

You hand the algorithm unlabeled customer data and ask it to find groups. K-means wants you to declare the number of groups up front. Hierarchical clustering builds every possible grouping at once and lets you cut later.

You fix , the target number of clusters, then iterate:

The objective is to minimize within-cluster sum of squares (WCSS):

KEY: Each iteration weakly decreases WCSS, so the algorithm converges. But it converges to a local minimum, not the global one. Re-run with multiple random starts and keep the lowest WCSS.

Choosing K. Plot WCSS against ; look for the elbow where adding clusters stops yielding big drops. The silhouette score and gap statistic give more rigorous alternatives.

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

Common mistakes

Bottom line

Exam shortcut

If the question fixes K and asks you to iterate centroids, it is K-means. If it mentions a dendrogram or linkage, it is hierarchical. The word "chaining" almost always points to single linkage. With tens of thousands of rows and both methods offered, pick K-means on complexity alone.

The full lesson (about 3,670 words, 24 min read) adds 6 worked examples, all 8 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.