MM-03 Clustering of records (k-means; hierarchical (agglomerative) clustering; DBSCAN (density-based spatial clustering of applications with noise); HDBSCAN (hierarchical DBSCAN))
Group records by distance or density without predefined categories and produce a cluster label per record, with centroids, a dendrogram or a noise label.
What it does
Groups records by distance or density without predefined categories. Artefact: a cluster label per record, centroids or a dendrogram, and a noise label for density-based methods. Read cluster sizes, centroid profiles and stability across restarts.
When to use it
Use when you want to find natural groups among records and have no predefined segments.
When it does not fit
K-means assumes convex, similarly spread clusters and needs the number of clusters in advance. Ward linkage needs Euclidean distance. Density-based clustering needs a distance setting that is hard to choose. Misuse: treating clusters as natural categories when the algorithm always returns the requested number.
Result format
The result has a cluster label for each record, a table of cluster sizes and centroids or a dendrogram, and a noise label where a density-based method was used. It reports the profile of each cluster and its stability across restarts.
Requirements on the material
| Property | Requirement type | Requirement |
|---|---|---|
| Structure | Applies in some cases | requires=structured |
| Content type | Always applies | requires=tabular |
| Unit of analysis | Always applies | requires=record |
| Variable types | Raises a warning | prefers=interval; prefers=ratio |
| Level of detail available | Always applies | requires=record-level |
| Appraises source credibility | Applies in some cases | no |
Not restricted on: Time structure, How the sample was chosen, Number of sources, Whether sources can be joined, Amount of material, Known data problems, Producer interest, Source dependence, Origin, Document genre, Language, Personal information, Security classification, Licence.
| Minimum material | at least 50 records and two or more variables |
|---|---|
| Additional sources needed | none |
| Not for (rules) | none |
| Not for (text) | Wrong choice when clusters are expected to be treated as natural categories, because k-means always returns the number of clusters requested. Misfit appears when clusters are not convex or have very different spread. |
Choosing and ordering
| Kind of technique | Primary technique, runs in step 5.3 |
|---|---|
| Phase tag | analyse |
| Other phase tags | none |
| Kind of finding | pattern; difference |
| Question answered | what; who |
| Strongest statement it supports | describe |
| Needs as input |
|
| Makes as output |
|
| Must exist first | None |
| Loop target | return to analyse |
Library checks by stakes
Each stakes level includes the checks of the level below it. Checks that need a person apply at high stakes only, so the process leaves them out at lower stakes (decision 38). Repeatability: repeatable with fixed settings.
| Stakes | Check | Person involved | Counts as a different method |
|---|---|---|---|
| exploratory | input validation | none | no |
| exploratory | repeat runs | none | no |
| decision-informing | input validation | none | no |
| decision-informing | repeat runs | none | no |
| decision-informing | sensitivity analysis | none | no |
| high-stakes | input validation | none | no |
| high-stakes | repeat runs | none | no |
| high-stakes | sensitivity analysis | none | no |
| high-stakes | second technique with different assumptions | none | conditional |
| high-stakes | independent review | needed | no |
Failure modes and limits
| Model suitability | human judgement required |
|---|---|
| Typical model failure | Invents segment descriptions that the centroids do not support, or fits a pattern to noise. |
| Error sources | input data; data transformation; statistical assumptions |
| Certainty limits | Certainty drops when clusters change across restarts, algorithms or scaling choices (inconsistency) and when cluster labels are read as real categories (indirectness). |
Related techniques
- pairs with CK-09 Cluster validation indexes (silhouette score; adjusted Rand index; adjusted mutual information; V-measure; stability analysis): validation indexes compare cluster numbers and algorithms
- should follow MM-04 Dimensionality reduction (PCA (principal component analysis); factor analysis; non-negative matrix factorisation): reducing many correlated fields can stabilise distance-based clusters
- should follow PE-04 Data profiling and rule-based validation (data audit; data quality assessment; edit checks): unit and range problems distort distances
Evidence and tag basis
Documented. The documentation states that k-means inertia "assumes that clusters are convex and isotropic". (scikit-learn clustering)
Tag basis: input profile inference; selection inference; sequencing inference; robustness inference. All tag values are inference unless a source is named.