Deterministic Feature Selection for $k$-means Clustering
Christos Boutsidis, Malik Magdon-Ismail
Introduction
This paper is about feature selection for -means clustering, a topic that received considerable attention from scientists and engineers. Arguably, -means is the most widely used clustering algorithm in practice . Its simplicity and effectiveness are remarkable among all the available methods . On the negative side, using -means to cluster high dimensional data with, for example, billions of features is not simple and straightforward ; the curse of dimensionality makes the algorithm very slow. On top of that, noisy features often lead to overfitting, another undesirable effect. Therefore, reducing the dimensionality of the data by selecting a subset of the features, i.e. feature selection, and optimizing the -means objective on the low dimensional representation of the high dimensional data is an attractive approach that not only will make -means faster, but also more robust .
The natural concern with throwing away potentially useful dimensions is that it could lead to a significantly higher clustering error. So, one has to select the features carefully to ensure that one can recover comparably good clusters just by using the dimension-reduced data. Practitioners have developed numerous feature selection methods that work well empirically . The main focus of this work is on algorithms for feature selection with provable guarantees. Recently, Boutsidis et al. described a feature selection algorithm that gives a theoretical guarantee on the quality of the clusters that are produced after reducing the dimension . Their algorithm, which employs a technique of Rudelson and Vershynin , selects the features randomly with probabilities that are computed via the right singular vectors of the matrix containing the data ( describes a similar randomized algorithm with the same bound but faster running time). Although Boutsidis et al. give a strong theoretical bound for the quality of the resulting clusters (we will discuss this bound in detail later), the bound fails with some non negligible probability, due to the randomness in how they sample the features. This means that every time the feature selection is performed, the algorithm could (a) fail, and (b) return a different answer each time. To better address the applicability of such feature selection algorithms for -means, there is a need for deterministic, provably accurate feature selection algorithms. We present the first deterministic algorithms of this type. Our contributions can roughly be summarized as follows.
Deterministic Supervised Feature Selection (Theorem 2). Given any dataset and any input -partition of this dataset, there is a small set of feature dimensions in which any near optimal output -partition of the data is no more than a constant factor worse in quality than the given input -partition (the quality of the input and output -partitions are compared in the original dimension). Moreover, this small set of feature dimensions can be computed in deterministic low-order polynomial time. This is the first deterministic algorithm of this type. Prior work gives a randomized algorithm that can only reduce to dimensions and guarantee comparable clustering quality.
Existence of a small set of near optimal features (Corollary 3). We prove existence of a small set of near optimal features. That is, given any dataset and the number of clusters , there is a set of feature dimensions such that any optimal -partition in the reduced dimension is no more than a constant factor worse in quality than the optimal -partition of the dataset. The existence of such a small set of features was not known before. Prior work only implies the existence of features with comparable performance.
Deterministic Unsupervised Feature Selection (Theorem 4). Given any dataset and the number of clusters , it is possible, in deterministic low-order polynomial time, to select feature dimensions, for any , such that the optimal -partition of the dimension-reduced data is no more than worse in quality than the optimal -partition; here is the number of features of the dataset. This is the first deterministic algorithm of this type. Prior work offers a randomized algorithm with error , for .
Unsupervised Feature Selection with a small subset of features (Theorem 5). Finally, given any dataset and the number of clusters , in randomized low-order polynomial time it is possible to select a small number, , of feature dimensions, with , such that the optimal -partition for the dimension-reduced data is no more than worse in quality than the optimal -partition. In particular, this is the first (albeit randomized) algorithm of this type that can select a small subset of feature dimensions and provide an -factor guarantee. Prior work is limited to selecting features. The new algorithm combines ideas from this paper with the technique of .
In order to prove our results we prove a structural result in Lemmas 10 and 11. This structural result quantifies the tradeoffs when selecting feature dimensions in terms of how the feature selection process preserves the matrix norms of certain crucial matrices. This is a general structural result and may be of independent interest.
In order to get deterministic algorithms and be able to select feature dimensions, we need to use techniques that are completely different from those used in . Our approach is inspired by a recent deterministic result for decompositions of the identity which was introduced in and subsequently extended in , while use the randomized technique of to extract the features. This general approach might also be of interest to the Machine Learning and Pattern Recognition communities, with potential applications to other problems involving subsampling, for example sparse PCA and matrix approximation .
We first provide the basic background on -means clustering that is needed to describe our results in Section 2. We postpone the more technical background needed for describing our main algorithms and for proving our main results to Section 3. We begin with the definition of the -means clustering problem.In Section 3, we provide an alternative definition using matrix notation, which will be useful in proving the main results of this work. Consider a set of points in an -dimensional Euclidian space,
and an integer denoting the desired number of clusters. The objective of -means is to find a -partition of such that points that are “close” to each other belong to the same cluster and points that are “far” from each other belong to different clusters. A -partition of is a collection
of non-empty pairwise disjoint sets which covers . Let be the size of . For each set , let be its centroid (the mean point),
where is the centroid of the cluster to which belongs. The goal of -means is to find a partition which minimizes for a given and . We will refer to any such optimal clustering as,
The goal of feature selection is to construct points
(for some specified in advance) by projecting each onto of the coordinate dimensions. Consider the optimum -means partition of the points in ,
The goal of feature selection is to construct a new set of points such that,
Here, is the approximation factor and might depend on and . In words, computing a partition by using the low-dimensional data and plugging it back into the clustering metric for the high dimensional data, gives an -approximation to the optimal value of the -means objective function. Notice that we measure the quality of by evaluating the -means objective function in the original space, an approach which is standard . Comparing directly to , i.e. the identity of the clusters, not just the clustering error, would be much more interesting but at the same time a much harder (combinatorial) problem. A feature selection algorithm is called unsupervised if it computes by only looking at and . Supervised algorithms construct with respect to a given partition of the data. Finally, an algorithm will be a -approximation for -means () if it finds a clustering with corresponding value Such algorithms will be used to state our results in a more general way.
[k-means approximation algorithm] An algorithm is a “-approximation” for -means clustering () if it takes as input the dataset and the number of clusters , and returns a clustering such that,
The simplest algorithm with , but exponential running time, would try all possible -partitions and return the best. Another example of such an algorithm is in with (). The corresponding running time is . Also, the work in describes a method with and running time . The latter two algorithms are randomized. For other -approximation algorithms, see as well as the discussion and the references in .
Statement of our main results
We first discuss guarantees for supervised feature selection when the user has a candidate input -partition. We next present results for the unsupervised case. We end this section with a brief discussion of the results.
Our first result is within the context of supervised feature selection. Suppose that we are given points and some -partition . The goal is to find the features of the points in from which we can find a partition that is not much worse than the given partition . Notice that if is arbitrarily bad, then might be much better than ; however, our bound does not capture how much better the resulting partition would be. It only guarantees that it will not be much worse than the given partition.
There is an time deterministic feature selection algorithm which takes as input any set of points , a number of clusters , a number of features to be selected , and a -partition of the points . The algorithm constructs such that , an arbitrary -approximation on , satisfies
Asymptotically, as , the approximation factor is . Essentially the clustering is at most a constant factor worse than the original clustering ; but, was computed using the lower dimensional data. This means we can compress the number of the feature dimensions without destroying a given specific clustering in the data. This is useful, for example, in privacy preserving applications where one seeks to release minimal information of the data without destroying much of the encoded information . Notice that the feature selection part of the theorem (i.e. the construction of ) is deterministic. The -approximation algorithm, which can be randomized, is only used to describe the clustering that can be obtained with the features returned by our deterministic feature selection algorithm (same comment applies to Theorem 4). The corresponding algorithm is presented as Algorithm 4 along with the proof of the theorem in Section 5. Prior to this result, the best, and in fact the only method with theoretical guarantees for this supervised setting is randomizedWe should note that describes the result for the unsupervised setting but it’s easy to verify that the same algorithm and bound apply to the supervised setting as well. and gives
Further, requires , otherwise the analysis breaks. We improve this bound by a factor of ; also, we allow the user to select as few as features.
A surprising existential result is a direct corollary of the above theorem by setting and using an optimal clustering algorithm on the reduced dimension data ().
For any set of points , integer , and , there is a set of features such that, if
In words, for any dataset there exist a small subset of features such that the optimal clustering on these features is at most a -factor worse than the optimal clustering on the original features. Unfortunately, finding these features without the knowledge of is not obvious.
2 Unsupervised Feature Selection
Our second result is within the context of unsupervised feature selection. In unsupervised feature selection, the goal is to obtain a -partition that is as close as possible to the optimal -partition of the high dimensional data. The theorem below shows that it is possible to reduce the dimension of any high-dimensional dataset by using a deterministic method and obtain some theoretical guarantees on the quality of the clusters.
There is an time deterministic algorithm which takes as input any set of points , a number of clusters , and a number of features to be selected . The algorithm constructs such that , an arbitrary -approximation on , satisfies
Asymptotically, as and , the approximation factor is . The corresponding algorithm is presented as Algorithm 5 along with the proof of the theorem in Section 5. Prior to this result, the best method for this task was given in , which replaces with and it is randomized, i.e. this bound is achieved only with a constant probability. Further, requires , so one cannot select features. Clearly, our bound is worse but we achieve it deterministically, and it applies to any , even .
Finally, it is possible to combine the algorithm of Theorem 4 with the randomized algorithm of and obtain the following result.
There is an time randomized algorithm which takes as input any set of points , a number of clusters , and a number of features to be selected . The algorithm constructs such that , an arbitrary -approximation on , satisfies with probability ,
Since , the approximation factor is ; there is no result in the literature which provides an approximation guarantee for selecting features. Note that the theorem is stated with the assumption , even though the corresponding algorithm (Algorithm 6) runs with any . This is because the algorithm of Theorem 5 is essentially the main algorithm of when (that is, we do not provide an improved result for ). What we achieve is to break the barrier of having to select features. So, Theorem 5, to the best of our knowledge, is the best available algorithm in the literature providing theoretical guarantees for unsupervised feature selection in -means clustering using features. The proof of Theorem 5 is given in Section 5. Comparing Theorem 5 with Theorem 4, we obtain a much better approximation bound at the cost of introducing randomization. We note here that the main algorithm of can be obtained as Algorithm 6 in Section 5 after ignoring the 4th and 5th steps and replacing the approximate SVD with the exact SVD in the first step (the algorithm in uses approximate SVD as we do in Algorithm 6).
3 Discussion
For unsupervised feature selection, the theoretical guarantee from the deterministic algorithm is weak, but we suspect that it may perform very well in practice on typical input data matrices. The empirical investigation of this algorithm would also be an interesting future direction.
All our algorithms require the top singular vectors of the data matrix (or an approximation to the top singular vectors). Then, the selection of the features is done by looking at the structure of these singular vectors and using the deterministic techniques of . We should note that takes a similar approach as far as computing the (approximate) singular vectors of the dataset; then employ the randomized technique of to extract the features.
The high level description of our results for unsupervised feature selection assumed that the output partition, obtained in the reduced-dimension space, is the optimal one: . This is the case if we assume a -approximation algorithm with . Notice, though, that our theorems are actually more general and can accomodate any .
Preliminaries
We now provide the necessary technical background that we will use in presenting our algorithms and proving our main theorems in Section 5.
2 Approximate Singular Value Decomposition
3 Linear Algebraic Definition of k𝑘k-means
4 Spectral Sparsification and Rudelson’s concentration Lemma
For a vector and scalar , define the function
At each iteration , the algorithm selects , for which
The running time of the algorithm is dominated by the search for an index satisfying
A structural bound for clustering error with feature selection
In this section, we develop two lemmas which are general structural bounds for the clustering error when using feature selection. These lemmas are the basis for all of our algorithms, and hence are crucial to proving our results, specifically Theorems 2, 4, and 5 (recall that there is no algorithm for Corollary 3 since that result is non-constructive).
(See Section 3.1 for the definition of the pseudo-inverse operator.) Then,
In the first 3 steps, we have used spectral submultiplicativity, and in the last step we have used the definition of the spectral norm of the pseudo-inverse. Combining all these bounds together (and using ):
Proofs of Main Theorems
This rank requirement follows from Lemma 7, because
2 Proof of Theorem 4
To bound the second term on the right hand side, we use spectral submultiplicativity to obtain
The result now follows by using the bounds from Lemma 8,
3 Proof of Theorem 5
We state the corresponding algorithm as Algorithm 6. To prove Theorem 5, we start with the general bound of Lemma 10; to apply the lemma, we need to satisfy the rank assumption, which will become clear shortly, during the course of the proof.
We can now apply the Markov’s inequality, to obtain that with probability at least ,
To bound the denominator of the second term, observe that
Thus, using (7) and (8) in (10), we get that with probability at least ,
By a simple application of Markov’s inequality and the union bound, both of the equations below hold with probability at least ,
Using (11),(12),(13) and (14) in (15), together with a union bound, we obtain that with probability at least
The running time of Algorithm 6 is , since it employs the approximate SVD of Lemma 6, the randomized technique of Lemma 9, and the deterministic technique of Lemma 7.
Related work
Feature selection has received considerable attention in the machine learning and pattern recognition communities. A large number of different techniques appeared in prior work, addressing feature selection within the context of both clustering and classification. Surveys include , as well as , which reports the results of the NIPS 2003 challenge in feature selection. Popular feature selection techniques include the Laplacian scores , the Fisher scores , or the constraint scores . None of these feature selection algorithms have theoretical guarantees on the performance of the clusters obtained using the dimension-reduced features.
The result most closely related to ours is the work in . This work provides a randomized algorithm which offers a theoretical guarantee. Specifically, for , it is possible to select features such that the optimal clustering in the reduced-dimension space is a -approximation to the optimal clustering. Our result improves upon this in two ways. First, our algorithms are deterministic; second, by using our deterministic algorithms in combination with this randomized algorithm, we can select features and obtain a competitive theoretical guarantee.
Next, we should mention that if one allows linear combinations of the features (feature extraction rather than feature selection), then there are algorithms that offer theoretical guarantees. First there is the SVD itself, which constructs (mixed) features for which the optimal clustering in this feature space is a -approximation to the optimal clustering . It is possible to improve the efficiency of this SVD algorithm considerably by using the approximate SVD (as in Lemma 6) instead of the exact SVD to get nearly the same approximation guarantee with features. The exact statement of this improvement can be found in . Boutsidis et al. show how to select (mixed) features with random projections and also obtaining a -guarantee. While these algorithms are interesting, they do not produce features that preserve the integrity of the original features. The focus of this work is on what one can achieve while preserving the original features.
A complementary line of research approaches the -means problem by sub-sampling the points of the dataset; such a subset of points is called coreset. The idea here is to select a small subset of the points and by using only this subset obtain a partition for all the points that is as good as the partition that would have been obtained by using all the points. offer algorithms for approximate partitions. Note that we were able to give only constant factor approximations. For example, shows the existence of an -approximate coreset of size ( is the number of features). provides a coreset of size . The techniques used for all these coresets are different from the techniques we used for feature selection; further, there is no clear way on how to use a coreset selection algorithm to select features. Moreover, the authors of use the coreset-based algorithm from to design a PTAS for k-means and other clustering problems. It would be interesting to understand whether the techniques from are useful for feature selection as well. In particular, it appears that there is potential to obtain relative error feature selection -means algorithms by using such approaches.
Acknowledgements
Christos Boutsidis acknowledges the support from XDATA program of the Defense Advanced Research Projects Agency (DARPA), administered through Air Force Research Laboratory contract FA8750-12-C-0323.