Efficient volume sampling for row/column subset selection
Amit Deshpande, Luis Rademacher
Introduction
Volume sampling, i.e., picking -subsets of the rows of any given matrix with probabilities proportional to the squared volumes of the simplicies defined by them, was introduced in in the context of low-rank approximation of matrices. It is equivalent to sampling -subsets of with probabilities proportional to the corresponding by principal minors of any given by positive semidefinite matrix.
In the context of low-rank approximation, volume sampling is related to a problem called row/column-subset selection . Most large data sets that arise in search, microarray experiments, computer vision, data mining etc. can be thought of as matrices where rows and columns are indexed by objects and features, respectively (or vice versa), and we need to pick a small subset of features that are dominant. For example, while studying gene expression data biologists want a small subset of genes that are responsible for a particular disease. Usual dimension reduction techniques such as principal component analysis (PCA) or random projection fail to do this as they typically output singular vectors or random vectors which are linear combinations of a large number of feature vectors. A recent article by Mahoney and Drineas highlights the limitations of PCA and gives experimental data on practical applications of low-rank approximation based on row/column-subset selection.
Row/column-subset selection and volume sampling
In other words, the rows of are projections of the rows of onto . Because of this, most dimension reduction techniques based on the singular value decomposition, e.g., principal component analysis (PCA), are interpreted as giving ’s as the dominant vectors, which happen to be linear combinations of a large number of the rows or feature vectors of .
Several row-sampling techniques have been considered in the past as an approximate but faster alternative to the singular value decomposition, in the context of streaming algorithms and large data sets that cannot be stored in random access memory . The first among these is the squared-length sampling of rows introduced by Frieze, Kannan and Vempala . Another sampling scheme due to Drineas, Mahoney and Muthukrishnan uses the singular values and singular vectors to decide the sampling probabilities. Later Deshpande, Rademacher, Vempala and Wang introduced volume sampling as a generalization of squared-length sampling.
The application of volume sampling to low-rank approximation and, more importantly, to the row-subset selection problem, is given by the following theorem shown in . It says that picking a subset of rows according to volume sampling and projecting all the rows of onto their span gives a -approximation to the nearest rank- matrix to .
As we will see later, this easily implies
Theorem 2 gives only an existence result for row-subset selection and we also know a matching lower bound that says this is the best we can possibly do.
However, no efficient algorithm was known for volume sampling prior to this work. An algorithm mentioned in Deshpande and Vempala does -approximate volume sampling in time , which means that plugging it in Theorem 2 can only guarantee -approximation instead of . Finding an efficient algorithm for volume sampling is mentioned as an open problem in the recent monograph on spectral algorithms by Kannan and Vempala (see Section of ).
Boutsidis, Drineas and Mahoney gave an alternative approach to row-subset selection (without going through volume sampling) and here is a re-statement of the main theorem from their paper which uses columns instead of rows.
Row/column-subset selection problem is related to rank-revealing decompositions considered in linear algebra , and the previous best algorithmic result for row-subset selection in the spectral norm case was given by a result of Gu and Eisenstat on strong rank-revealing QR decompositions. The following theorem is a direct consequence of as pointed out in .
Moreover, this subset can be found in time .
In the context of volume sampling, it is interesting to note that Pan has used an idea of picking submatrices of locally maximum volume (or determinants) for rank-revealing matrix decompositions. We refer the reader to for details.
The results of Goreinov, Tyrtyshnikov and Zamarashkin on pseudo-skeleton approximations of matrices look at submatrices of maximum determinants as good candidates for row/column-subset selection.
Our main result is a polynomial time algorithm for exact volume sampling. In Section 4, we give an outline of our Algorithm 1, followed by two possible subroutines given by Algorithms 2 and 3 that could be plugged into it.
The algorithm just described informally, if implemented as stated, would have a polynomial dependence in , and , for some low-degree polynomial. We can do better and get a linear dependence in by working with in place of and computing the projected matrices using rank- updates (Theorem 7), while still having a polynomial time guarantee and sampling exactly. It would be even faster to perform rank-1 updates to the characteristic polynomial itself, but that requires the computation of the inverse of a polynomial matrix (Proposition 18), and it is not clear to us at this time that there is a fast enough exact algorithm that works for arbitrary matrices. Jeannerod and Villard give an algorithm to invert a generic -by- matrix with entries of degree , with a power of two, in time . This would lead to the computation of all marginal probabilities for one row in time (a variation of Algorithm 3 and its analysis).
Instead, if we are willing to be more practical, while sacrificing our guarantees, then we can perform rank- updates to the characteristic polynomial by using the singular value decomposition (SVD). In , an algorithm with cost arithmetic operations is given for the singular value decomposition but the SVD cannot be computed exactly and we do not know how its error propagates in our algorithm which uses many such computations. If the SVD of an -by- matrix can be computed in time , this leads to a nearly-exact algorithm for volume sampling in time . See Proposition 18 for details.
Volume sampling was originally defined in to prove Theorem 2, in particular, to show that any matrix contains rows in whose span lie the rows of a rank- approximation to that is no worse than the best in the Frobenius norm. Efficient volume sampling leads to an efficient selection of rows that satisfy this guarantee, in expectation. In Section 5, we use the method of conditional expectations to derandomize this selection. This gives an efficient deterministic algorithm (Algorithm 4) for row-subset selection with the following guarantee in the Frobenius norm. This guarantee immediately implies a guarantee in the spectral norm, as follows:
This improves the -approximation of Boutsidis, Drineas and Mahoney for the Frobenius norm case and matches the lower bound shown in Theorem 3 due to .
Using random projection for dimensionality reduction, the polynomial time algorithm for volume sampling mentioned in Theorem 7 (i.e., Algorithm 1 with Algorithm 2 as its subroutine), gives -approximate volume sampling, using
Finally, we show a lower bound for row/column-subset selection in the spectral norm that almost matches our upper bound in terms of the dependence on .
Preliminaries and notation
Throughout the paper we assume . This assumption is not needed most of the time, but justifies sometimes working with instead of and, more generally, some choices in the design of our algorithms. It is also partially justified by our use of a random projection as a preprocessing step that makes small.
can be generalized into the following lemma.
where are the singular values of , i.e., eigenvalues of , and
is the characteristic polynomial of . Using , we can alternatively use in the above formula, for .
Let be the exponent of the arithmetic complexity of matrix multiplication. We use that there is an algorithm for computing the characteristic polynomial of an -by- matrix using arithmetic operations [2, Section 16.6].
Here is another lemma that we will need about dividing determinants into products of two determinants.
To show this, we consider two cases. If is singular, then both sides of the equality are zero. If is invertible, then we can perform block Gaussian elimination and write
applied to . Writing the determinants of the block-triangular matrices gives
Now, the projection of the rows of a matrix onto the row-space of a matrix can be written as
so that , and
Finally, a well-known lemma about how the determinant of a matrix changes under a rank- update.
Efficient volume sampling algorithms
We first outline our volume sampling algorithm to convince the reader that volume sampling can be done in polynomial time. In the subsequent subsections, we give improved subroutines to get faster implementations of the same idea.
The main idea behind our algorithm is based on Lemma 14 about the marginal probabilities encountered in volume sampling. To explain this, it is more convenient to look at volume sampling defined as a distribution on -tuples instead of -subsets, where each of the permutations of a -subset is equally likely, i.e., for any ,
Then the marginal probabilities have the following interpretation in terms of the coefficients of certain characteristic polynomials.
Let such that , for a random -tuple from the extended volume sampling over -tuples. Let , and . Then,
With this lemma in hand, let us consider the following outline of our algorithm. We will later give two more efficient implementations of this outline, depending on how the ’s are computed.
Output: a subset of rows of picked with probability proportional to .
Initialize and . For to do:
where is a matrix obtained by projecting each row of orthogonal to .
Pick with probability proportional to . Let and .
Now we show the correctness of the algorithm:
The probability that our volume sampling algorithm outlined above picks a -subset is proportional to . This algorithm can be implemented with a cost of arithmetic operations.
By Lemma 14, for any such that , the probability that our algorithm picks a sequence of rows indexed in that order is equal to
Otherwise, the probability is zero because in the execution of the algorithm, for some step . This proves the correctness of our algorithm.
Given that one can compute the characteristic polynomial of an -by- matrix in (see Section 3), our outline can be implemented with the following count of arithmetic operations: for every and , to compute , in total for . Thus, volume sampling in . ∎
First subroutine for marginal probabilities
Compute the characteristic polynomial of and output
can be computed in time . Observe that since is obtained by projecting each row of orthogonal to ,
So once we have , for each , can be computed in time and the characteristic polynomial of can be computed in time [2, Section 16.6]. By Lemma 11, and hence, the above subroutine results into an time algorithm for volume sampling. ∎
The proof follows by combining Proposition 15 and Proposition 16, and since we compute all the ’s simultaneously in each round in arithmetic operations, the total number of arithmetic operations is . ∎
2 Efficient volume sampling using SVD
Taking further the idea that each is a rank- update of , we can give a faster algorithm based on the singular value decomposition of . Given the singular value decomposition of a matrix and using the matrix determinant lemma (Lemma 13), one can give a precise formula for how the characteristic polynomial changes under a rank- update. Using this subroutine in the volume sampling algorithm outlined in Section 4 we get an algorithm for nearly-exact volume sampling (depending on the precision of the computed SVD) in time , where is the running time of SVD on an -by- matrix.
Second subroutine for marginal probabilities.
In the real arithmetic model and given exact and , using the Algorithm 3 as a subroutine inside Algorithm 1 outlined for volume sampling, we get an algorithm for volume sampling. If is the running time for computing the singular value decomposition of -by- matrices, the algorithm runs in time .
Using the matrix determinant lemma (Lemma 13), the characteristic polynomial of can be written as
Once we have the singular value decomposition of , and can all be computed in time using polynomial products. This is because there are at most non-zero ’s. Thus, and all the for can be computed in time and then using the above formula we get . ∎
3 Approximate volume sampling in nearly linear time
Magen and Zouzias showed that the random projection lemma of Johnson and Lindenstrauss can be generalized to preserve volumes of subsets after embedding. Here is a restatement of Theorem 1 of using instead of in their original statement.
Using random projection for dimensionality reduction, the polynomial time algorithm for volume sampling mentioned in Theorem 7 (i.e., Algorithm 1 with Algorithm 2 as its subroutine), gives -approximate volume sampling, using
Moreover, this can be implemented using only one pass over the matrix with extra space . ∎
Derandomized row/column-subset selection
Our derandomized row-subset selection algorithm is based on a derandomization of the volume sampling algorithm in Section 4, using the method of conditional expectations. Again, it may be easier to consider volume sampling extended to random -tuples where
where the expectation is over .
Let us consider for which . Let and look at the conditional expectation. The following lemma shows that these conditional expectations have an easy interpretation in terms of the coefficients of certain characteristic polynomials, and hence can be computed efficiently.
Let be such that for a random -tuple from extended volume sampling. Let and . Then
Knowing the above lemma, it is easy to derandomize our algorithm outlined for volume sampling. In each step, we just compute the new conditional expectations for each additional , and finally pick the that minimizes the conditional expectation.
Output: a subset of rows of with the guarantee
Initialize and . For to do:
For to do: compute and , where is the matrix obtained by projecting each row of orthogonal to .
Pick that minimizes . Let and .
By applying Lemma 21 to instead of , as , we see that the step of our algorithm picks that minimizes
The correctness of our algorithm follows immediately from observing that in each step ,
The guarantee for spectral norm follows immediately from our guarantee in the Frobenius norm, just using properties of norms and the fact that :
Moreover, this algorithm runs in time if we use the subroutine in Subsection 4.1 to compute the characteristic polynomial of using that of . ∎
Lower bound for rank-111 spectral approximation using one row
Let be the best rank- approximation to whose rows lie in the span of (or for that matter, any fixed row of ). Then, we want to show that
is an eigenvector of with eigenvalue . Thus, . Observe that, by symmetry, all other singular values of must be equal, i.e., . However,
Therefore, .
Now denote the -th row of by . By definition, the -th row of is the projection of onto . We are interested in the singular values of . For :
Again, is the top eigenvector of and using this we get,
Discussion
We analyzed efficient algorithms for volume sampling that can be used for row/column subset selection. Here are some ideas for future investigation suggested by this work:
It would be interesting to explore how these algorithmic ideas are related to determinantal sampling and, in particular, the generation of random spanning trees.
Find practical counterparts of the algorithms discussed here. In particular, we do not analyze the numerical stability of our algorithms.
Is there an efficient algorithm for volume sampling based on random walks? This question is inspired by MCMC as well as random walk algorithms for the generation of random spanning trees.