Clustering
Study guides: Exam SRM, Exam MAS-II, DISC-DA, Exam ACIA-CAPSTONE, ILA-M1
Clustering is a set of unsupervised methods for finding subgroups, or clusters, among the observations of a data set, so that observations in a cluster are similar to each other and different from those in other clusters. There is no response variable, and the methods find structure only in the variables used. Clustering is often used in exploratory data analysis. The two main methods, K-means and hierarchical clustering, compare as follows:
| K-means | Hierarchical | |
|---|---|---|
Number of clusters K |
chosen in advance and fixed | chosen afterwards, by cutting the dendrogram |
| Start | a random assignment, so runs can differ | none, so the result is the same every time |
Clusters for different K |
found afresh for each K |
nested |
| Result | K clusters |
a tree that gives every K |
For the same number of clusters the two methods need not give the same clusters, because they use different algorithms.
Two analysts run K-means with
K = 3on the same data and get different clusters. Would hierarchical clustering cut at three clusters also differ between them?
- K-means starts from a random assignment and finds only a local optimum, so two runs can give different clusters.
- Hierarchical clustering has no random start, so with the same dissimilarity and linkage both analysts get the same dendrogram.
- Cutting it at three clusters gives them the same clusters.
Dissimilarity and scaling
Clustering needs a dissimilarity measure between observations, usually Euclidean distance, sometimes a correlation-based distance. When the variables are left on their raw scales, the distance is dominated by the variable with the largest numeric spread, so that variable drives the clusters. Standardizing each variable to standard deviation one gives every variable equal weight. Whether to standardize depends on the application, and it is advisable when the variables are measured in different units.
Two drivers are aged 30 and 60 and drive 12,000 and 12,500 miles a year. Which variable drives their Euclidean distance on the raw scales?
- The distance is
\sqrt{30^2 + 500^2} = 500.9.- Without the age difference it would be 500, so mileage decides almost all of it.
- After standardizing, a 30-year age gap would count as much as a gap of the same number of standard deviations in mileage.
Clustering the features
Clustering usually groups the observations on the basis of the features, to find subgroups among the observations. It can just as well group the features on the basis of the observations, to find subgroups among the features, by transposing the data matrix.
Validating the clusters
Clustering returns clusters whether or not the data contain real subgroups. The results depend on choices that each change the clusters:
- Whether to standardize the variables.
- Which dissimilarity measure and which linkage to use.
- Where to cut the dendrogram, or how many clusters to ask K-means for.
Both K-means and hierarchical clustering force every observation into a cluster, so a few observations that belong to no subgroup can distort the clusters found. Neither is very robust either: clustering again after removing a random subset of the observations often gives quite different clusters. Several choices are tried, the most useful and interpretable result is kept, and subsets of the data are clustered to see which clusters hold up.
An insurer clusters its policyholders on telematics variables and wants to use the clusters as rating segments. What should it check first?
- The clusters separate the policyholders in the telematics variables, which does not mean that they differ in expected losses, so they must be tested against loss experience.
- Each cluster must be large enough for its experience to be credible.
- The clusters must be stable on other data or another time period, since clustering finds clusters even where there are no real subgroups.
Clustering in ratemaking
In risk classification, clustering groups risks or the levels of a rating variable into homogeneous groups, so that the variance within each group is small and the variance between groups is large. In territorial ratemaking it groups basic geographic units with similar smoothed relativities into territories.
Clustering is not classification Clustering uses no response. A method trained on labelled outcomes, such as a decision tree that predicts claim occurrence, is supervised, not a cluster analysis.
Practice questions
- CAS Exam 8 Fall 2015, Question 6
- CAS Exam 8 Fall 2016, Question 2
- CAS Exam 8 Fall 2019, Question 4
- Exam DISC-DA Practice Question 209
- Exam DISC-DA Practice Question 226
- Exam DISC-DA Practice Question 227
- Exam DISC-DA Practice Question 234
- CAS Exam MAS-I Spring 2018, Question 35
- CAS Exam MAS-II Fall 2019, Question 40
- CAS Exam MAS-II Fall 2019, Question 42
- CAS Exam MAS-II Spring 2019, Question 42
- SOA Exam SRM Sample Question 1
- SOA Exam SRM Sample Question 2
- SOA Exam SRM Sample Question 15
- SOA Exam SRM Sample Question 16
- SOA Exam SRM Sample Question 32
- SOA Exam SRM Sample Question 34
- SOA Exam SRM Sample Question 36
- SOA Exam SRM Sample Question 40
- SOA Exam SRM Sample Question 43
- SOA Exam SRM Sample Question 59
- SOA Exam SRM Sample Question 60