Abstract
Entropy weighted k-means (ewkm) by Liping Jing, Michael K. Ng and Joshua Zhexue Huang (2007) doi:10.1109/TKDE.2007.1048 is a weighted subspace clustering algorithm that is well suited to very high dimensional data. Weights are calculated as the importance of a variable with regard to cluster membership. The two-level variable weighting clustering algorithm tw-k-means (twkm) by Xiaojun Chen, Xiaofei Xu, Joshua Zhexue Huang and Yunming Ye (2013) doi:10.1109/TKDE.2011.262 introduces two types of weights, the weights on individual variables and the weights on variable groups, and they are calculated during the clustering process. The feature group weighted k-means (fgkm) by Xiaojun Chen, Yunminng Ye, Xiaofei Xu and Joshua Zhexue Huang (2012) doi:10.1016/j.patcog.2011.06.004 extends this concept by grouping features and weighting the group in addition to weighting individual features.
Introduction
Standard k-means clustering treats every dimension (variable) in a dataset as equally important. However, in high-dimensional settings—such as genomics, text mining, or sensor networks—many variables are often irrelevant or represent noise. Furthermore, different variables might be important for defining different clusters; a gene might be a perfect marker for "Cluster A" but completely irrelevant for "Cluster B."
This is the challenge of subspace clustering. Traditional methods often struggle with the "curse of dimensionality," where the distance between points becomes less meaningful as more irrelevant dimensions are added. The wskm R package addresses this by implementing algorithms that learn the importance of each variable (or group of variables) dynamically as the clusters are formed.
Methodology
The wskm package provides a suite of "soft" subspace clustering algorithms that extend the classic k-means approach. It implements three primary algorithms:
- Entropy Weighted k-Means (ewkm): This algorithm introduces an entropy penalty to the k-means objective function. It calculates a weight for every variable within each cluster. Variables that contribute more to the compactness of a cluster receive higher weights, effectively "zooming in" on the relevant subspace for that specific group.
- Two-level Variable Weighting (twkm): This extends
ewkmby recognizing that variables often come in natural groups. It calculates two sets of weights: one for individual variables and one for the variable groups themselves. - Feature Group Weighted k-Means (fgkm): Similar to
twkm, this algorithm focuses on grouping features and weighting those groups in addition to individual features to improve discrimination in very high-dimensional spaces.
The algorithms use a parameter $\lambda$ to control the weight distribution. A large $\lambda$ (e.g., > 3) encourages weights to be spread evenly across variables, while a small $\lambda$ (e.g., < 1) forces the algorithm to be more "selective," giving high weights to only the most discriminative features.
Implementation and Results
The package includes a predict method to assign new data points to existing clusters based on learned weights and a specialized plot function to visualize the importance of variables across clusters. The output objects are designed to be compatible with standard R kmeans objects.
Key implementation features include:
- Automated Grouping: The
twkmandfgkmfunctions can accept group information as either a formatted string (e.g.,"0-9;10-19") or a vector. - Convergence Control: A
maxrestartparameter is included to handle "empty clusters" that can occur in subspace clustering by automatically restarting the process to ensure the requested number of clusters is reached. - Efficiency: The algorithms are designed to handle thousands of observations and hundreds of variables, as demonstrated in the package's sample datasets.
Discussion and Limitations
Unlike global feature selection, these algorithms identify local importance. A variable can have a high weight for one cluster and a low weight for another. This allows for a more nuanced understanding of the "signature" of each cluster.
However, users must be aware of certain limitations. Like all k-means variants, these algorithms are distance-based and sensitive to data scaling. It is crucial to rescale data (e.g., using the scale function) before clustering. Additionally, the effectiveness of the clustering is highly dependent on hyperparameters like lambda (variable weight) and eta (group weight), which often require domain-specific tuning or cross-validation.
Summary updated