Near-optimal Coresets For Least-Squares Regression
Christos Boutsidis, Petros Drineas, Malik Magdon-Ismail
Introduction
Linear regression is an important technique in data analysis . Research in the area ranges from numerical techniques to robustness of the prediction error to noise (e.g., using feature selection ). We ask whether it is possible to efficiently identify a small subset of the data that contains all the essential information of a learning problem. Such a subset is called a “coreset”. We show that the answer is yes, for linear regression. Such a coreset is analogous to the support vectors in support vector machines . Such coresets contain the meaningful or important points in the data and can be used to find good approximate solutions to the full problem by solving a (much) smaller problem. When the constraints are complex (e.g., non-convex constraints), solving a much smaller regression problem could be a significant saving .
We present coreset constructions for constrained regression (both simple and multiple response), as well as lower bounds for the size of coresets that achieve certain accuracy. In addition to potential computational savings, a coreset identifies the important core of a machine learning problem and is of considerable interest in applications with huge data where incremental approaches are necessary (for example chunking) and applications where the data is distributed and bandwith is costly (hence communicating only the essential data is imperative ).
Our first contribution is a deterministic, polynomial-time algorithm for constructing a coreset for arbitrarily constrained linear regression. Let be the “effective dimension” of the data (the rank of the data matrix) and let be the desired accuracy parameter. Our algorithm constructs a coreset of size , which achieves a -relative error performance guarantee. In other words, solving the regression problem on the coreset results in a solution which fits all the data with an error which is at most worse than the best possible fit to all the data. We extend our results to the setting of multiple response regression using more sophisticated techniques. Our proofs are based on two sparsification tools from linear algebra , which may be of general interest to the machine learning community, and we discuss these in some detail.
Assume the usual setting with data points ; are feature vectors (which could have been obtained by applying a non-linear feature transform to raw data) and are targets (responses). The linear regression problem asks to determine a vector that minimizes
over , where are positive weights. So, , for all . The domain represents the constraints on the solution, e.g., in non-negative least squares (NNLS) , , the nonnegative orthant. Our results hold for arbitrary .
A coreset of size is a subset of the data points, . The coreset regression problem considers the squared error on the coreset with a (possibly) different set of weights ,
The algorithm which constructs the coreset should also provide the weights . For the remainder of the paper, we switch to an equivalent matrix formulation of the problem. (See Appendix for linear algebra background.)
Let be the data matrix whose rows are the weighted data points ; and let be the similarly weighted target vector, , where for denotes the th element of . The effective dimension of the data can be measured by the rank of ; let . Our results hold for arbitrary , however, in most applications, and . We can rewrite the squared error as , so,
A coreset of size is a subset of the rows of and the corresponding elements of . Let be a positive diagonal matrix for the coreset regression (the weights of the coreset regression will depend on ). The weighted squared error on the coreset is given by
We say that such a coreset is an -coreset if the solution obtained by fitting the coreset data is almost optimal for all the data. Formally,
2 Our contributions
In this section, we discuss our main results for various formulations of linear regression (also summarized in Table 1). In the next section we present the relevant algorithms and proofs.
Our main result for constrained simple regression is Theorem 1, which describes a deterministic polynomial time algorithm that constructs a -coreset of size . Prior to our work, the best result achieving comparable relative error performance guarantees is Theorem 1 of for constrained regression, and the work of for unconstrained regression. Both of these prior results construct coresets of size and they are randomized, so, with some probability, the fit on all the data can be arbitrarily bad (despite the coreset being a logarithmic factor larger). Our methods have comparable, low order polynomial running times and provide deterministic guarantees. The results in and were achieved using the matrix concentration results in . However, these concentration bounds break unless the coreset size is .
2.2 Multi-Objective Regression (Section 3.1)
An important variant of multiple response regression is the so-called multi-objective regression. Let
2.3 Arbitrarily-Constrained Multiple-Response Regression (Section 3.2)
Using the same approach, converting the problem to a single response regression, we construct a -coreset for Frobenius-norm arbitrarily-constrained regression in Section 3.2. The coreset size in this case is .
2.4 Unconstrained Multiple-Response Regression (Section 4)
In Section 4, we consider coresets for unconstrained multiple-response regression for both the spectral and Frobenius norms. The sizes of the coresets are smaller than the constrained case, and our main results are presented in Theorems 6 and 7. Theorem 6 presents a -coreset of size for spectral norm regression, while Theorem 7 presents a -coreset of size for Frobenius norm regression.
2.5 Lower Bounds (Section 5)
Finally, in Section 5, we present lower bounds on coreset sizes. In the single response regression setting, we note that our algorithms need to look at the target vector . We show that this is unavoidable, by arguing that no -agnostic deterministic coreset construction algorithm can construct coresets which are small (Theorem 13). We also present similar results for -agnostic randomized coreset constructions (Theorem 14).
Then, we present lower bounds on the size of coresets for spectral and Frobenius norm multiple response regression that apply in the general, non -agnostic, setting (Theorems 15 and 16).
Constrained Linear Regression
We define constrained linear regression as follows: given of rank , , and , we seek for which , for all (the domain represents the constraints on and can be arbitrary). To construct a coreset (i.e., consists of rows of ) and (i.e., consists of elements of ), we introduce sampling and rescaling matrices and respectively. More specifically, we define the row-sampling matrix whose rows are basis vectors . Our coreset is now equal to ; clearly, is a matrix whose rows are the rows of corresponding to indices . Similarly, contains the corresponding elements of the target vector. Next, let be a positive diagonal rescaling matrix and define the -weighted regression problem on the coreset as follows:
In the above, the operator first samples and then rescales rows of and . Theorem 1 is the main result in this section and presents a deterministic algorithm to select a coreset by constructing and .
The running time of the proposed algorithm is , where is the time needed to compute the left singular vectors of the matrix .
For any , we can set to get an approximation ratio roughly equal to . This result considerably improves the result in , which needs to achieve the same approximation ratio. Additionally, our bound is deterministic, whereas the bound in fails with constant probability. also requires an SVD computation in the first step, so its running time is comparable to ours.
In order to prove the above theorem, we need a linear algebraic sparsification result from , specifically Theorem 3.1 in , which we restate using our notation (we present the corresponding algorithm below).
We now discuss in more detail the sparsification algorithm of Lemma 2. We present the corresponding algorithm as Algorithm 6. Our notation deviates from the original in ; we employ our own presentation of the corresponding algorithm in . Algorithm 6 is a greedy technique that selects columns one at a time. To describe the algorithm in more detail, it is convenient to view the input matrix as a set of column vectors,
and let be defined as
and let be defined as
The running time of the algorithm is dominated by the search for an index satisfying
Constrained Multiple-Response Regression
Constrained multiple-response regression in the Frobenius norm can be reduced to simple regression. So, we can apply the results of the previous section to this setting.
Let and , with . The objective of multi-objective regression is:
where contains copies of . Let (here is a vector of all ones and thus is the average of the columns in ). Recall that , , and let .
The run time of the proposed algorithm is , where is the time needed to compute the left singular vectors of the matrix .
We first construct and via Theorem 1 applied to and . The running time is (the time needed to compute ) plus the running time of Theorem 1. The result is immediate from the following derivation:
2 Arbitrarily-Constrained Multiple-Response Regression
Multi-objective regression is a special case of constrained multiple-response regression for which we can efficiently obtain the coresets. In the general case, the problem still reduces to simple regression, but the coresets are now larger. The objective of arbitrarily-constrained multiple-response regression is
Since is isomorphic to , we can view as a “stretched out” vector ; corresponding to the domain is the domain . Similarly, we can stretch out to . To complete the transformation to simple linear regression, we build a transformed block-diagonal data matrix from , by repeating copies of along the diagonal:
So, for the approximation ratio to be , we set . The running time would involve the time needed to compute the SVD of .
Notice that the coresets are large and somewhat costly to compute and they only work for the Frobenius norm. In the next section, using more sophisticated techniques, we will get smaller coresets for unconstrained regression in both the Frobenius and spectral norms.
Unconstrained Multiple-Response Regression
We can compute via the pseudoinverse of , namely . If and are sampling and rescaling matrices respectively, then the coreset regression problem is:
Given a matrix with rank , a matrix , and , Algorithm 3 deterministically constructs matrices and such that the solution of the problem of Eqn. (7) satisfies:
The running time of the proposed algorithm is , where is the time needed to compute the left singular vectors of .
Since , the approximation ratio is . So, for and the approximation ratio is . For , the approximation is , while for , is asymptotic to . We will argue that this is nearly optimal by providing a matching lower bound in Theorem 15.
Given matrix of rank , matrix , and Algorithm 4 deterministically constructs a sampling matrix and a rescaling matrix such that the solution of the problem of Eqn. (7) satisfies:
The running time of the proposed algorithm is , where is the time needed to compute the left singular vectors of .
The approximation ratio in the above theorem is . In Theorem 16, we will give a lower bound for the approximation ratio which is . We conjecture that our lower bound can be achieved (deterministically), perhaps by a more sophisticated algorithm or analysis.
Finally, we note that the -agnostic randomized construction of achieves a approximation ratio using a significantly larger coreset, . Importantly, does not need any access to in order to construct the coreset, whereas our approach constructs coresets by carefully choosing important data points with respect to the particular target response matrix . We will also discuss -agnostic algorithms in Section 4.2 (Theorem 12) and we will present matching lower bounds in Section 5.
We will make heavy use of facts from Section A in the Appendix. We start with a few simple lemmas.
Let be the regression residual. Then, .
Using our notation, . To conclude notice that for any matrices and .
We now present our main tool for obtaining approximation guarantees for coreset regression.
To simplify notation, let . Using the SVD of , , we get:
where the last equality follows from properties of the pseudo-inverse and the fact that is a full-rank matrix (see Lemma 18 in the Appendix). Using , we obtain
follows from the assumption that the rank of is equal to and thus and follows by matrix-Pythagoras (Lemma 17). To conclude, we use spectral submultiplicativity on the second term and the fact that .
This lemma provides a framework for coreset construction: all we need are sampling and rescaling matrices and , such that and
is small. The final ingredients for the proofs of Theorems 6 and 7 are two matrix sparsification results that we present in the Appendix.
If , the running time of the algorithm reduces to . We write to denote such a deterministic procedure.
If , the running time of the algorithm reduces to . We write to denote such a deterministic procedure.
(of Theorem 6) Theorem 6 follows from Lemmas 9 and 10. First, compute the SVD of to obtain , and let . Next, run the algorithm of Lemma 10 to obtain . This algorithm runs in time , where is the rank of and . The total running time of the algorithm is .
Lemma 10 guarantees that and satisfy the rank assumption of Lemma 9. To conclude the proof, we bound the second term of Lemma 9, using the bounds of Lemma 10 and :
(of Theorem 7) The proof is similar to the proof of Theorem 6, using Lemma 11 instead of Lemma 10. Let We bound the second term of Lemma 9, using the bounds of Lemma 11:
2 𝐁𝐁{\mathbf{B}}-Agnostic Coreset Construction
All the coreset construction algorithms that we presented so far carefully construct the coreset using knowledge of the response vector. If the algorithm does not need knowledge of to construct the coreset, and yet can provide an approximation guarantee for every , then the algorithm is -agnostic. A -agnostic coreset construction algorithm is appealing because the coreset, as specified by the sampling and rescaling matrices and , can be computed off-line and applied to any . We briefly digress to show how our methods can be extended to develop -agnostic coreset constructions.
The running time of the proposed algorithm is , where is the time needed to compute the left singular vectors of .
The proof is similar to the proof of Theorem 6, except we now construct the sampling and rescaling matrices as . To bound the second term in Lemma 9, we use
The above bound decreases with and holds for any , guaranteeing a constant-factor approximation with a constant fraction of the data. The approximation ratio is , which seems quite weak. In the next section, we show that this result is indeed tight.
Lower Bounds on Coreset Size
We have just seen a -agnostic coreset construction algorithm with a rather weak worst case guarantee of approximation error. We will now show that no deterministic -agnostic coreset construction algorithm can guarantee a better error (Theorem 13) by providing lower bounds on coreset size as a function of approximation error. These results are also summarized in Table 2.
provides another -agnostic coreset construction algorithm with . For a fixed , the method in delivers a probabilistic bound on the approximation error. However, there are target matrices for which the bound fails by an arbitrarily large amount. The probabilistic algorithms get away with this by brushing all these (possibly large) errors into a low probability event, with respect to random choices made in the algorithm. So, in some sense, these algorithms are not -agnostic, in that they do not construct a coreset which works well for all with some (say) constant probability. Nevertheless, the fact that they give a constant probability of success for a fixed but unknown makes these algorithms interesting and useful. We will give a lower bound on the approximation ratio of such algorithms as well, for a given probability of success (Theorem 14). Finally, we will give lower bounds on the size of the coreset for the general (non-agnostic) multiple regression setting (Theorems 15 and 16).
We first present the lower bound for simple regression. Recall that a coreset construction algorithm is -agnostic if it constructs a coreset without knowledge of , and then provides an approximation guarantee for every . We show that no coreset can work for every ; therefore a -agnostic coreset will be bad for some vector . In fact, there exists a matrix such that every coreset has an associated “bad” .
There exists a matrix such that for every coreset of size , there exists (depending on ) for which
Let project onto the columns of and project onto the first column of . The following sequence establishes the result:
We now consider randomized algorithms that construct a coreset without looking at (e.g. ). These algorithms work for any fixed (but unknown) , and deliver a probabilistic approximation guarantee for any single fixed ; in some sense they are -agnostic. By the previous discussion, the returned coreset must fail for some , i.e., the probabilistic guarantee does not hold for all , and, when it fails, it could do so with very bad error. We will now present a lower bound on the approximation accuracy of such existing randomized algorithms for coreset construction, even for a single .
First, we define randomized coreset construction algorithms. Let be the different coresets of size . A randomized algorithm assigns probabilities to each coreset, and selects one according to these probabilities. The probabilities may depend on . The algorithm is -agnostic if the probabilities do not depend on . As usual, let be the size of the coreset.
2 Lower Bounds for Non-Agnostic Multiple Regression
For both the spectral and the Frobenius norm, we now consider non-agnostic unconstrained multiple regression, and give lower bounds for coresets of size (for simplicity, we set ). The results are presented in Theorems 15 and 16.
First, we need some results from . Consider the matrix
where are the standard basis vectors. Then, let . Theorem 34 in (with ) argues the following: given and any sampling matrix and diagonal rescaling matrix , with (rescaled sampled coreset of ), and any with ,
In the above, of rank is the best rank- approximation to (in the spectral norm) whose rows lie in the span of all the rows in (the row-space of ); and, of rank is the best rank- approximation to (which could be computed via the truncated SVD of ).Actually, is irrelevant here because the row-space of is the same as the row space of .
Since is the best rank- approximation to in the row-space of , it follows that
for any with rank at most (because will have rank at most and is in the row space of ). Set , where has columns which are the top- left singular vectors of . It is easy to verify that has the correct dimensions and rank at most . Since , we have that
To conclude the proof, observe that .
As and the lower bound is .
First, we need some results from . For any integer and any integer , Theorem 36 in exhibits a matrix such that for any sampling matrix and diagonal rescaling matrix , with (rescaled sampled coreset of ), any , and any ,
The matrix is constructed as follows. Recall that is any positive integer with . Let have dimensions and be constructed as follows.
where are the standard basis vectors. Now construct to be block diagonal, with copies of along its diagonal; so, the dimensions of are . Then, .
In the above, of rank is the best rank- approximation to (in the Frobenius norm) whose rows lie in the span of all the rows in (the row-space of ); and, of rank is the best rank- approximation to (which could be computed via the truncated SVD of ). Since is the best rank- approximation to in the row-space of , it follows that
for any with rank at most (because will have rank at most and is in the row space of ). Set , where has columns which are the top- left singular vectors of . It is easy to verify that has the correct dimensions and rank at most . Since , we have that
We now construct the regression problem which proves the lower bound in the theorem. Let (i.e., we choose in the above discussion), (i.e. is a multiple of in the regression problem), and . is as we described above. Suppose a coreset construction algorithm gives sampling and rescaling matrices and , for a coreset of size . So, the coreset regression is with and . The solution to the coreset regression is
To conclude the proof, observe that and .
Open problems
An important open problem arises in our work: can we determine the minimum size of a coreset that provides a relative-error guarantee for simple linear regression? We conjecture that is a lower bound, which will make our results almost tight. Certainly, coresets of size exactly cannot be guaranteed: consider two data points . The optimal regression is zero; however any coreset of size one will give non-zero regression.
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. Petros Drineas and Malik Magdon-Ismail have been supported by NSF CCF 1016501, NSF DMS 1008983, and NSF CCF CAREER 824684.
References
Appendix A Linear Algebra Background
The Singular Value Decomposition (SVD) of a matrix of rank is a decomposition
The singular values are contained in the diagonal matrix ; contains the left singular vectors of ; and contains the right singular vectors. The Moore-Penrose pseudo-inverse of is Given an orthonormal matrix , the perpendicular matrix to satisfies: , , and . All the singular values of both and are equal to one. Given , can be computed in deterministic time via the QR factorization.
Let and be two matrices. If or , then
Appendix B Algorithms and Proofs of Lemmas 10 and 11
We now provide all the details of the proofs and the corresponding algorithms of Lemmas 10 and 11. Those results, which have been described in detail in , are slight extensions of two algorithms presented in , which themselves extend the original spectral sparsification result of Batson, Spielman, and Srivastava . More specifically, Lemma 20 below - in some sense - generalizes Lemma 2; indeed, setting in Lemma 20 gives Lemma 2. Lemma 19 below also describes a deterministic algorithm for sampling columns from two matrices but the goal here is to optimize different spectral properties in the sampled matrices.
In this section of the Appendix, we will slightly abuse notation by denoting with a sampling matrix which samples columns - not rows - from matrices. We will later use to be consistent with the notation used throughout the paper.
We write to denote this procedure.
Algorithm 5 is a greedy technique that selects columns one at a time. To describe the algorithm in more detail, it is convenient to view the input matrices as two sets of vectors,
Given and , introduce the iterator and define the parameter
For a square symmetric matrix with eigenvalues , and , define
and let be defined as
where 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
If , it runs in ; we write for this procedure.
If , the running time of the algorithm reduces to . We write to denote such a deterministic procedure.
(a) uses Lemma 18. To obtain the first inequality in the lemma we need to take and observe that , and . We now prove the second inequality in the lemma,
To obtain the second inequality in the lemma we need to take and use and .
B.2 Proof of Lemma 11
If , the running time of the algorithm reduces to . We write to denote such a deterministic procedure.
which by taking gives the second inequality in the lemma,
Now we prove the first inequality in the lemma,
(a) uses Lemma 18. To conclude, use .