MAS-II · Statistical Learning · Free Lesson

Perform the computations behind clustering procedures (e.g., K-means, hierarchical).

Free CAS MAS-II (Modern Actuarial Statistics II) lesson in Statistical Learning. 19 min read, ~2,807 words.

A claims-severity team wants to segment 50,000 policyholders by behavior without using any labeled outcome. Clustering is unsupervised: no YY, just structure in XX.

Why two families. K-means is fast and scales to millions of points but requires KK and is sensitive to initialization. Hierarchical produces a full tree you can cut at any level, but is O(n2)O(n^2) in memory and gets brittle past about 10,000 points. The 50,000-policyholder segmentation from the opener therefore goes to K-means: the hierarchical pairwise matrix would need roughly 2.5 billion entries, well past the memory wall.

WCSS measures how tight each cluster is: small squared distances from each point to its centroid mean the cluster is a coherent group, while large distances mean members are scattered. Given nn points x1,…,xn∈Rpx_1,\dots,x_n \in \mathbb{R}^p and a target number of clusters KK, K-means partitions points into clusters C1,…,CKC_1,\dots,C_K to minimize:

WCSS=∑k=1K∑i∈Ck∥xi−xˉk∥2\text{WCSS} = \sum_{k=1}^{K}\sum_{i\in C_k}\|x_i - \bar{x}_k\|^{2}

where xˉk=1∣Ck∣∑i∈Ckxi\bar{x}_k = \frac{1}{|C_k|}\sum_{i\in C_k} x_i is the centroid.

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

Common mistakes

Bottom line

Exam shortcut

If the problem gives KK and starting centroids, expect a K-means trace: do one or two iterations of assign-then-update, then check whether assignments stabilized. If the problem gives a pairwise distance matrix and asks for merge order, it is agglomerative hierarchical: find the smallest entry, merge, update with the named linkage rule, repeat.

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

Learning objectives

Browse all free MAS-II lessons or jump into free MAS-II practice questions.