- Introduced by
- Witten, D. M. & Tibshirani, R. (sparse k-means formulation)
- Year
- 2010
- Type
- Regularized unsupervised clustering
- Family
- Machine learning
What does it do?
Regularized k-means extends standard k-means by adding a sparsity-inducing penalty on the feature weights used in the clustering objective.
In the lasso-type (L1) form of Witten and Tibshirani (2010), known as sparse k-means, the clusters are estimated using an adaptively chosen subset of the features, so variables that carry little cluster structure contribute little to the solution. The method is most relevant when many features are likely to be irrelevant to the partition. It is distinct from constraint-based k-means, which uses must-link and cannot-link constraints rather than feature weighting.
The intuition behind the method
Standard k-means weights every feature equally when measuring distance, so irrelevant or noisy variables can blur the cluster structure. Regularized k-means estimates the cluster assignments and a set of feature weights together. A lasso-type penalty encourages the weights of weakly informative features to shrink toward zero, so those features contribute little or nothing to the distances. A stronger penalty leaves fewer features active and gives a sparser solution, while a weaker penalty moves the result closer to standard k-means.
History
Regularized k-means draws on the lasso approach to penalized regression, applied to clustering. The most cited formulation is the sparse k-means framework of Witten and Tibshirani, published in the Journal of the American Statistical Association in 2010 as 'A Framework for Feature Selection in Clustering'. That work used a lasso-type penalty to select features and demonstrated the approach on simulated data and genomic datasets. Later extensions are not covered in detail on this page.
When to use it
Choose regularized k-means when the data contain many features and you expect only a subset to define the cluster structure, as in the high-dimensional settings (including genomic data) examined by Witten and Tibshirani (2010). It is useful when you want feature selection carried out within the clustering itself rather than as a separate preprocessing step. Do not use it when all features are known to be informative and comparably scaled, since standard k-means is simpler in that case. It is also a poor fit when clusters are strongly non-spherical or differ widely in density, where density-based or mixture-model methods are usually more appropriate. Choosing K and the sparsity parameter requires a validation strategy, so plan for it before relying on the result.
Limitations and considerations
- Inherits k-means assumptions: clusters are treated as roughly spherical, and distance-based assignment works poorly when cluster shapes or densities differ widely.
- Requires choosing both K and a sparsity parameter, so model selection is more demanding than for standard k-means.
- The alternating updates make each run more costly than standard k-means, and the procedure converges only to a local solution.
- Feature weights are shared across all clusters, so a feature that separates only one cluster may be down-weighted in the overall solution.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Selects features as part of the clustering, with one criterion governing both feature choice and cluster assignment, as described in the cited framework.
- Reduces the influence of uninformative features that would otherwise distort the distances used by standard k-means.
- Produces sparser feature-weight profiles, which can make the features driving the partition easier to inspect.
- Suited to wide datasets in which the number of features is large relative to the number of observations.
Applications
- Clustering gene expression profiles when many genes are measured but only some separate the groups of interest.
- Customer segmentation from wide feature sets that include many weakly informative behavioural variables.
- Text document clustering, where sparse feature weights can point to the terms that separate the groups.
- Sensor-array data in which many channels carry redundant or uninformative signals.
How it works
How it works
Choose K starting centers, for example by random selection of observations. K-means++ seeding is a common choice in standard k-means practice to reduce sensitivity to the start; the cited paper does not prescribe it for the sparse variant. Each point is then assigned to its nearest center to begin the alternating procedure.
The sparse k-means criterion is a weighted between-cluster dispersion objective in which the feature weights are constrained by an L1 bound together with a norm constraint. The L1 constraint lives on the weights, not on the assignment step. Without a normalization constraint the weights would simply shrink toward zero, so the constraint set matters. The displayed formula is therefore left empty here: the exact criterion must be taken from Witten and Tibshirani (2010) before implementation. The step that uses the weights is the assignment: with the weights held fixed, each point is assigned to the cluster whose center is nearest under the weighted distance.
With the cluster assignments held fixed, the feature weights are updated to favour features whose between-cluster dispersion is large. The L1 constraint on the weights, which is where sparsity enters, shrinks the weights of weakly contributing features and allows some to become exactly zero. Features with zero weight take no part in later distance computations. The precise update rule is given in Witten and Tibshirani (2010) and should be implemented from that paper.
Given the current assignments, each cluster center is the mean of its member points on each feature. The feature weights enter through the distance used to assign points, not through this mean.
Formula
\bar{x}_{kj} = \frac{1}{|C_k|} \sum_{i \in C_k} x_{ij}Alternate the assignment, center and weight updates until the cluster assignments stop changing or a maximum number of iterations is reached. Because the procedure is iterative, the result can depend on the starting centers, so repeated starts are advisable. The sparsity parameter is chosen separately from the iterations, using a validation criterion.
Common pitfalls
- Choosing the sparsity parameter arbitrarily instead of using a documented validation approach.
- Skipping feature standardization; without it, features with large variances can dominate the weighted distances regardless of their cluster information.
- Reading the selected features as causes of the cluster structure; they are discriminative of the partition found, not established drivers.
- Fixing K without comparing alternatives, since the sparsity penalty does not determine the number of clusters.
- Assuming sparser solutions are better; excessive sparsity can remove features that carry genuine cluster information.
Frequently asked questions
How do I choose the regularization parameter lambda?
The sparsity parameter controls how many features remain active, and there is no single universal rule for it. The cited work frames sparsity through an L1 bound on the weights, and a Lagrangian penalty parameter lambda is a related but different way to express the same trade-off; the two are not numerically interchangeable. Resampling-based or permutation-based criteria are the kind of approach to use for selecting this parameter, and the exact procedure should be taken from Witten and Tibshirani (2010). General cluster-quality measures such as the silhouette or Calinski-Harabasz score can be used as additional checks, but they are not tuning criteria validated for sparsity in that paper.
What is the difference between regularized k-means and sparse k-means?
Sparse k-means, introduced by Witten and Tibshirani (2010), is the most prominent instance of regularized k-means and uses a lasso-type penalty to select features. Other regularized variants use different penalties and are not covered here. Constrained k-means, which enforces must-link or cannot-link constraints between points, is a separate method based on pairwise supervision, not feature weighting.
Related methods
Sources
Witten, D. M., & Tibshirani, R. (2010). A framework for feature selection in clustering. Journal of the American Statistical Association, 105(490), 713–726.
Open DOI referenceK-means clustering. Wikipedia.
Open publication reference