22576 Chap.6 Cluster Analysis with k-Means and Hierarchical Methods
Cluster Analysis with k-Means and Hierarchical Methods
Clustering is the subject's unsupervised learning method, used to find natural segments when there is no outcome variable. This chapter covers k-means and how its quality is judged through cohesion and separation, the elbow chart and the silhouette value, then hierarchical clustering with its dendrogram and single, complete or group-average linkage.
It finishes with the preparation that decides most results: selecting variables, normalising scale, encoding categories and choosing a distance measure.
Clustering is one of the descriptive techniques the group brief requires, so its interpretation needs to be presentable to managers.
That means describing each cluster by its typical profile in original units, explaining why the number of clusters was chosen, and being ready to justify which variables were included, including whether the outcome variable belonged in the clustering at all.
What this chapter covers
- 01
Unsupervised versus supervised machine learning
- 02
Choosing k for k-means clustering
- 03
Cohesion, separation, elbow chart and silhouette
- 04
Hierarchical clustering and the dendrogram
- 05
Single, complete and group-average linkage
- 06
Encoding categories and choosing a distance measure
Worked example · free
Find the elbow in a k-means chart
- 1Drops: 480 from 1 to 2, 220 from 2 to 3, then 60, 35, 25, 18 and 12.
- 1The large gains stop after k = 3; from there each extra cluster buys only a small reduction.
- 1The elbow is at k = 3, which should then be checked against the average silhouette values.
Key terms
- Unsupervised learning
- Machine learning on data without a known outcome variable, used to discover hidden structure.
- k-means clustering
- A partitioning method that assigns observations iteratively to a pre-chosen number of clusters, k.
- Dendrogram
- A tree diagram showing the order and dissimilarity at which hierarchical clustering merges groups.
- Group-average linkage
- A rule that measures the similarity of two clusters by averaging over all pairs between them.
- Cluster cohesion
- How close observations within the same cluster are to each other.
- Cluster separation
- How far apart observations in different clusters are.
Cluster Analysis with k-Means and Hierarchical Methods FAQ
When should I use k-means rather than hierarchical clustering?
The workshop links k-means to larger samples, over about 500 observations, and hierarchical clustering to smaller ones. k-means needs the number of clusters fixed in advance, whereas a dendrogram lets you choose it afterwards by deciding where to cut the tree.
What does a silhouette value tell me?
It combines how close an observation is to its own cluster and how far it is from others, on a scale from −1 to 1. Values near 1 mean a good match, around zero mean a border case, and negative values mean the observation sits closer to another cluster.
Why must categorical variables be encoded before clustering?
Clustering measures distances between observations, which needs numbers. Each category becomes its own 0/1 column, for example one column per education level. Treat missing values first, and prefer Manhattan distance when many binary columns are included, as the Week 5 tutorial does.
Why fix a seed when running k-means?
k-means starts from randomly placed centroids, so separate runs can produce different clusters. Fixing a static seed, as the Week 5 tutorial does with 22576, makes the result reproducible, so your group, your tutor and your report all describe the same clusters.
How do I choose between Euclidean and Manhattan distance?
The workshop pairs Euclidean distance with continuous numerical variables and Manhattan distance with categorical or binary variables. When encoded dummy columns make up a large part of the input, as in the tutorial's home ownership columns, Manhattan distance is the safer choice.
Should the outcome variable be included in a clustering?
Usually not. Clustering is unsupervised and is meant to find natural groups without a known outcome, so including the variable you later want to explain can make the segments simply restate it. The sample presentation questions ask groups to justify this choice, so decide it deliberately and say why.
Assessment move
Run the Week 5 clustering workflow twice, once with a fixed seed and once without, and compare the cluster sizes. Then write a one-line business profile for each cluster from its average age, income and children, which is what a report reader needs. Practise reading a dendrogram by deciding where to cut it for two, three and four clusters and checking which observations end up together.
Working through Cluster Analysis with k-Means and Hierarchical Methods in 22576? Sia is AskSia’s AI Business Analytics tutor — ask any 22576 Cluster Analysis with k-Means and Hierarchical Methods question and get a clear, step-by-step explanation grounded in how 22576 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.