Sampling Algorithms and Coresets for Lp Regression
Anirban Dasgupta, Petros Drineas, Boulos Harb, Ravi Kumar, Michael W. Mahoney
Introduction
An important question in algorithmic problem solving is whether there exists a small subset of the input such that if computations are performed only on this subset, then the solution to the given problem can be approximated well. Such a subset is often known as a coreset for the problem. The concept of coresets has been extensively used in solving many problems in optimization and computational geometry; e.g., see the excellent survey by Agarwal, Har-Peled, and Varadarajan .
(2) Subspace-preserving sampling. We show that sampling rows of according to information in the rows of a well-conditioned basis of minimizes the sampling variance and consequently, the rank of is not lost by sampling. This is critical for our relative-error approximation guarantees. The notion of subspace-preserving sampling was used in for , but we abstract and generalize this concept for all .
We note that for , our sampling complexity matches that of , which is ; and for , it improves that of from to .
Overview of our methods. Given an input matrix , we first construct a well-conditioned basis for and use that to obtain bounds on a slightly non-standard notion of a -norm condition number of a matrix. The use of this particular condition number is crucial since the variance in the subspace preserving sampling can be upper bounded in terms of it. An -net argument then shows that the first stage sampling gives us a -approximation. The next twist is to use the output of the first stage as a feedback to fine-tune the sampling probabilities. This is done so that the “positional information” of with respect to is also preserved in addition to the subspace. A more careful use of a different -net shows that the second stage sampling achieves a -approximation.
2 Related work
Preliminaries
Two crucial ingredients in our proofs are -nets and tail-inequalities. A subset of a set is called an -net in for some if for every , there is a with . In order to construct an -net for it is enough to choose to be the maximal set of points that are pairwise apart. It is well known that the unit ball of a -dimensional space has an -net of size at most .
Finally, throughout this paper, we will use the following sampling matrix formalism to represent our sampling operations. Given a set of probabilities, , for , let be an diagonal sampling matrix such that is set to with probability and to zero otherwise. Clearly, premultiplying or by determines whether the -th row of and the corresponding element of will be included in the sample, and the expected number of rows/elements selected is . (In what follows, we will abuse notation slightly by ignoring zeroed out rows and regarding as an matrix and thus as an matrix.) Thus, e.g., sampling constraints from Equation (1) and solving the induced subproblem may be represented as solving
Main technical ingredients
We introduce the following notion of a “well-conditioned” basis.
The existence and efficient construction of these bases is given by the following.
Let be an matrix of rank , let , and let be its dual norm. Then there exists an -well-conditioned basis for the column space of such that: if , then and , if , then and , and if , then and . Moreover, can be computed in time (or in just time if ).
Let , where is any matrix that is an orthonormal basis for and is a matrix. If , then is the desired basis ; from the discussion following Definition 3, and , and computing it requires time. Otherwise, fix and and define the norm, . A quick check shows that is indeed a norm. ( if and only if since has full column rank; ; and .)
where (see, e.g. [9, pp. 413–4]). Since the matrix is symmetric positive definite, we can express it as , where is full rank and upper triangular. Since is an orthogonal basis for and is a matrix of full rank, it follows that is an matrix that spans the column space of . We claim that is the desired -well-conditioned basis.
In order to construct , we need to compute and and then invert . Our matrix can be decomposed into using the compact decomposition in time. The matrix describing the Löwner–John ellipsoid of the unit ball of can be computed in time. Finally, computing from takes time, and inverting takes time. ∎
2 Subspace-preserving sampling
In the previous subsection (and in the notation of the proof of Theorem 4), we saw that given , any matrix of rank can be decomposed as
where is a -well-conditioned basis for and . The significance of a -well-conditioned basis is that we are able to minimize the variance in our sampling process by randomly sampling rows of the matrix and elements of the vector according to a probability distribution that depends on norms of the rows of the matrix . This will allow us to preserve the subspace structure of and thus to achieve relative-error approximation guarantees.
More precisely, given and any matrix of rank decomposed as , where is an -well-conditioned basis for , consider any set of sampling probabilities for , that satisfy:
where to be determined below. Let us randomly sample the row of with probability , for all . Recall that we can construct a diagonal sampling matrix , where each with probability and otherwise, in which case we can represent the sampling operation as .
The following theorem is our main result regarding this subspace-preserving sampling procedure.
Several things should be noted about this result. First, it implies that , since otherwise we could choose a vector and violate the theorem. In this sense, this theorem generalizes the subspace-preservation result of Lemma of to all . Second, regarding sampling complexity: if the sampling complexity is , if it is , and if it is . Finally, note that this theorem is analogous to the main result of Schechtman , which uses the notion of Auerbach bases.
The sampling algorithm
In the second stage, the algorithm uses information from the residual of the -approximation computed in the first stage to refine the sampling probabilities. Define the residual (and note that ). Then, roughly rows of , and the corresponding elements of , are randomly sampled according to the probability distribution
Note that since the algorithm of Figure 1 constructs the -well-conditioned basis using the procedure in the proof of Theorem 4, our sampling complexity depends on and . In particular, it will be . Thus, if our sampling complexity is ; if it is ; and (although not explicitly stated, our proof will make it clear that) if it is . Note also that we have stated the claims of the theorem as holding with constant probability, but they can be shown to hold with probability at least by using standard amplification techniques.
2 Proof for first-stage sampling – constant-factor approximation
To prove the claims of Theorem 6 having to do with the output of the algorithm after the first stage of sampling, we begin with two lemmas. First note that, because of our choice of , we can use the subspace preserving Theorem 5 with only a constant distortion, i.e., for all , we have
with probability at least . The first lemma below now states that the optimal solution to the original problem provides a small (constant-factor) residual when evaluated in the sampled problem.
, with probability at least .
The next lemma states that if the solution to the sampled problem provides a constant-factor approximation (when evaluated in the sampled problem), then when this solution is evaluated in the original regression problem we get a (slightly weaker) constant-factor approximation.
If , then .
To conclude the proof of the claims for the first stage of sampling, note that by our choice of , Theorem 5 fails to hold for our first stage sampling with probability no greater than . In addition, Lemma 7 fails to hold with probability no grater than , which is no greater than for all . Finally, let be a random variable representing the number of rows actually chosen by our sampling schema, and note that . By Markov’s inequality, it follows that with probability less than . Thus, the first stage of our algorithm fails to give an -approximation in the specified running time with a probability bounded by .
3 Proof for second-stage sampling – relative-error approximation
The proof of the claims of Theorem 6 having to do with the output of the algorithm after the second stage of sampling will parallel that for the first stage, but it will have several technical complexities that arise since the first triangle inequality approximation in the proof of Lemma 8 is too coarse for relative-error approximation. By our choice of again, we have a finer result for subspace preservation. Thus, with probability , the following holds for all
As before, we start with a lemma that states that the optimal solution to the original problem provides a small (now a relative-error) residual when evaluated in the sampled problem. This is the analog of Lemma 7. An important difference is that the second stage sampling probabilities significantly enhance the probability of success.
, with probability at least .
Next we show that if the solution to the sampled problem provides a relative-error approximation (when evaluated in the sampled problem), then when this solution is evaluated in the original regression problem we get a (slightly weaker) relative-error approximation. We first establish two technical lemmas.
The following lemma says that for all optimal solutions to the second-stage sampled problem, is not too far from , where is the optimal solution from the first stage, in a -norm sense. Hence, the lemma will allow us to restrict our calculations in Lemmas 11 and 12 to the ball of radius centered at .
.
Thus, if we define the affine ball of radius that is centered at and that lies in ,
then Lemma 10 states that , for all optimal solutions to the sampled problem. Let us consider an -net, call it , with , for this ball . Using standard arguments, the size of the -net is . The next lemma states that for all points in the -net, if that point provides a relative-error approximation (when evaluated in the sampled problem), then when this point is evaluated in the original regression problem we get a (slightly weaker) relative-error approximation.
For all points in the -net, , if , then , with probability .
Finally, the next lemma states that if the solution to the sampled problem (in the second stage of sampling) provides a relative-error approximation (when evaluated in the sampled problem), then when this solution is evaluated in the original regression problem we get a (slightly weaker) relative-error approximation. This is the analog of Lemma 8, and its proof will use Lemma 11.
If , then .
To conclude the proof of the claims for the second stage of sampling, recall that the first stage failed with probability no greater than . Note also that by our choice of , Theorem 5 fails to hold for our second stage sampling with probability no greater than . In addition, Lemma 9 and Lemma 11 each fails to hold with probability no greater than 1/100. Finally, let be a random variable representing the number of rows actually chosen by our sampling schema in the second stage, and note that . By Markov’s inequality, it follows that with probability less than . Thus, the second stage of our algorithm fails with probability less than . By combining both stages, our algorithm fails to give a -approximation in the specified running time with a probability bounded from above by .
Extensions
In this section we outline several immediate extensions of our main algorithmic result.
References
Appendix A Tail inequalities
With respect to tail inequalities, we will use the following version of the Bernstein’s inequality.
Let be independent random variables with and . Set and let . Then
If for all , then with we have
Appendix B Proofs for Section 3
Equation 12 follows since, according to the definition of in Equation (5), may equal for some rows, and since these rows are always included in the random sample, for these rows. To bound the right hand side of Equation 12, note that for all such that ,
From Equation (13), if follows that for each such that ,
Thus, we may define . In addition, it also follows from Equation (13) that
from which it follows that .
To apply the upper tail bound in Theorem 13, define . It follows that and also that
where the second inequality follows by standard manipulations since and since . Thus, by Equation (10) of Theorem 13, it follows that
Similarly, to apply the lower tail bound of Equation (9) of Theorem 13, define . Since , we can follow a similar line of reasoning to show that
Choosing , we get that for every fixed , the following is true with probability at least :
where the last inequality follows since , , and
Appendix C Proofs for Section 4
Define . Thus, , and the first moment is . The lemma follows since, by Markov’s inequality,
i.e., , with probability no more than . ∎
C.2 Proof of Lemma 8
We will prove the contrapositive: If , then . To do so, note that, by Theorem 5, and the choice of , we have that
C.3 Proof of Lemma 9
Define the random variable , and recall that since . Clearly, . In addition, since , it follows that . We will use Equation (10) of Theorem 13 to provide a bound for .
From the definition of in Equation (7), it follows that for some of the rows, may equal (just as in the proof of Theorem 5). Since for these rows, , and thus we will bound this latter quantity with Equation (10). To do so, we must first provide a bound for and for . To that end, note that:
where the final inequality follows from the definition of and the results from the first stage of sampling. Next, note that from the conditions on the probabilities in Equation (7), as well as by Definition 3 and the output of the first-stage of sampling, it follows that
Thus, since , it follows that for all such that ,
where we set . Thus, we may define . In addition, it follows that
To apply the upper tail bound of Equation (10) of Theorem 13, define . We have , and since , we also have . Hence, by Equation (10) of Theorem 13, it follows that
Thus, , from which the lemma follows by our choice of . ∎
C.4 Proof of Lemma 10
By two applications of the triangle inequality, it follows that
where the second inequality follows since from the first stage of sampling and since . In addition, we have that
where the third inequality follows since is optimal for the sampled problem. The lemma follows since . ∎
C.5 Proof of Lemma 11
Fix a given point . We will prove the contrapositive for this point, i.e., we will prove that if , then , with probability at least . The lemma will then follow from the union bound.
To this end, define the random variable , and recall that since . Clearly, . In addition, since , it follows that . We will use Equation (9) of Theorem 13 to provide an upper bound for the event that , where , under the assumption that .
From the definition of in Equation (7), it follows that for some of the rows, may equal (just as in the proof of Theorem 5). Since for these rows, , and thus we will bound this latter quantity with Equation (9). To do so, we must first provide a bound for . To that end, note that:
where the final inequality follows from the radius of the high-dimensional ball in which the -net resides. From this, we can show that
To apply the lower tail bound of Equation (9) of Theorem 13, define . Thus, by Equation (21) and by Equation (9) of Theorem 13 it follows that
Since , it follows that , with probability no greater than . Since there are no more than such points in the -net, the lemma follows by the union bound. ∎
C.6 Proof of Lemma 12
We will prove the contrapositive: If then . Since lies in the ball defined by Equation (8) and since the -net is constructed in this ball, there exists a point , call it , such that . Thus,
Next, since Lemma 11 holds for all points in the -net, it follows that