- Introduced by
- Strehl, A. & Ghosh, J.
- Year
- 2002
- Type
- Ensemble clustering (consensus aggregation of K-means partitions)
- Family
- Machine learning
What does it do?
Ensemble K-means runs K-means many times with different random initializations, seeds, or feature subsets, then combines the resulting partitions into one consensus assignment.
It is used to reduce the dependence of K-means results on starting conditions, so that repeated analyses of the same data are more likely to produce the same clusters. The consensus partition should still be checked for stability and interpreted substantively rather than accepted by default.
The intuition behind the method
K-means is fast but sensitive to its starting conditions: two runs on the same data can produce different clusters. Ensemble K-means treats each run as one partial view of the data and records which pairs of points are placed together across runs. Pairs that co-occur in most runs are grouped with confidence, while ambiguous points are assigned according to the overall pattern of co-occurrence. The aim is a partition that depends less on the luck of one initialization. The ensemble does not change the geometry that K-means assumes, which is discussed under limitations.
History
Strehl and Ghosh (2002) introduced a knowledge reuse framework for combining multiple partitions, which is the cluster-ensemble setting in which Ensemble K-means is placed. Monti et al. (2003) developed a resampling-based method for class discovery and visualization of gene expression microarray data, which established consensus clustering as a tool for exploring subgroup structure in such data.
When to use it
Choose Ensemble K-means when a single K-means run gives results that change with the random starting point and reproducible clusters are needed, for example in exploratory analyses that will be repeated or reported. It is also useful when the number of clusters is uncertain, because runs can be made over a range of k. It suits continuous numeric features on comparable scales, where K-means is a reasonable base method. Do not apply it to mixed-type or categorical features: the base runs rely on Euclidean distances between numeric coordinates, so the clusters they produce would not be meaningful for such variables. Do not choose it if the clusters you expect are strongly elongated or non-convex: the base runs are still K-means and keep its preference for compact, roughly spherical groups, so a density-based or other non-spherical method may fit better. Do not use it as a replacement for substantive cluster validation. Avoid it when computation is tightly limited, since B runs cost roughly B times one run, or when very high-dimensional data are clustered without dimensionality reduction.
Limitations and considerations
- Cost grows linearly with B, since each ensemble member is a full K-means run.
- The co-association matrix has n-squared entries, so memory and computation become limiting as n grows; this is a structural cost of the pairwise representation.
- The consensus step introduces its own choices, such as the consensus function and the number of final clusters, which the ensemble does not fix.
- If the base runs are standard K-means with Euclidean distance, the ensemble inherits its assumption of compact, similarly scaled clusters; diversity among base clusterers is needed to relax this.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Usually more stable across repeated analyses than a single K-means run, because the result averages over many initializations.
- Because the aggregation uses co-membership rather than cluster labels, the cluster numbering in different runs does not need to be matched.
- Runs with different k values can be combined, which reduces reliance on a single choice of k.
- The co-association matrix gives a pairwise similarity that can be inspected or reused in downstream analysis.
- The B base runs are independent and can be executed in parallel.
Applications
- Genomics and transcriptomics: checking whether subgroups in gene-expression data recur across resampled runs, the setting in which Monti et al. developed consensus clustering.
- Customer segmentation: testing whether market segments remain the same across random initializations and subsamples of the data.
- Image segmentation: grouping pixels or regions where single K-means runs produce different segmentations.
- Document clustering: grouping text representations, where the starting point can change which topic groups are found.
- Exploratory analysis: checking whether an apparent cluster structure reappears across random seeds.
How it works
How it works
K-means is executed B times, typically with B in the range of 20 to 100, using different random initializations, seeds, or subsets of features. Each run produces a complete partition of the n data points into k clusters. Allowing k to vary across runs, for example by drawing it from a range, makes the ensemble less dependent on a single guess of the number of clusters.
An n-by-n co-association matrix is built by counting, for each pair of points, how many of the B runs place them in the same cluster. Because the matrix records co-membership rather than cluster labels, it is unaffected by the arbitrary numbering of clusters in each run, which avoids the label-matching problem that arises when labels are averaged directly. The matrix can be read as a soft similarity between points.
The co-association matrix is treated as a similarity (or distance) matrix and passed to a final clustering step. The options named for this step are agglomerative hierarchical clustering, a single final K-means pass, and graph-partitioning methods such as METIS. The choice of consensus function is an additional decision that affects the final partition.
Each data point receives its final label from the consensus step. One practical stability check is to recompute the co-association values with a larger ensemble and see whether the assignments stop changing; a plateau suggests the ensemble is large enough. This is a heuristic check rather than a formal guarantee of convergence.
Common pitfalls
- Using a very small ensemble (fewer than 20 runs): the co-association matrix stays noisy and the consensus may add little over a single run.
- Choosing k by convenience rather than by examining consensus stability across the range of k tried.
- Applying the method to high-dimensional data without dimensionality reduction, so that noisy dimensions dominate the distances used by each K-means run.
- Treating the consensus partition as ground truth without external or substantive validation of what the clusters mean.
Frequently asked questions
How many ensemble members B should I use?
A typical range is 20 to 100 runs, and 50 is a common starting point. Increase B until the consensus assignments stop changing as runs are added. This is a practical heuristic rather than a fixed rule. Fewer than 20 runs may give limited stability gains.
How do I choose the number of clusters k?
Run the ensemble over a range of k values and compare the results across k. One heuristic is the consensus cumulative distribution function (CDF) of the consensus matrix, where the relative change in the area under the CDF can suggest candidate values of k. Such diagnostics narrow the choice but do not identify a correct number, so candidates should be checked against stability and substantive interpretation.
Does Ensemble K-means solve K-means' assumption of spherical clusters?
Not fully. If all ensemble members use standard K-means with Euclidean distance, the aggregate still inherits a preference for convex, roughly spherical clusters. For non-convex or arbitrarily shaped clusters, the base clusterers need to be changed, for example by including DBSCAN among them or by using kernel K-means.
What is the difference between Ensemble K-means and just running K-means many times and picking the best?
Picking the single run with the lowest inertia keeps one partition and discards the others. Ensemble K-means keeps the co-membership information from all runs in the co-association matrix, which records how consistently pairs of points are grouped together. Whether this gives a better result depends on the data, but it does not rely on one run.
Is this suitable for very large datasets?
The co-association matrix has n-squared entries, so memory becomes the practical limit as n grows. For larger datasets, options named in the method description include sparse approximations, mini-batch K-means as the base clusterer, and subsampling as in the resampling approach of Monti et al.
Related methods
Sources
Strehl, A. & Ghosh, J. (2002). Cluster ensembles — a knowledge reuse framework for combining multiple partitions. Journal of Machine Learning Research, 3, 583–617.
Open publication referenceMonti, S., Tamayo, P., Mesirov, J. & Golub, T. (2003). Consensus clustering: a resampling-based method for class discovery and visualization of gene expression microarray data. Machine Learning, 52, 91–118.
Open DOI reference