Abstract
We provide a deterministic space-efficient algorithm for estimating ridge regression. For $n$ data points with $d$ features and a large enough regularization parameter, we provide a solution within $\epsilon$ $L_2$ error using only $O(d/\epsilon)$ space. This is the first $o(d^2)$ space deterministic streaming algorithm with guaranteed solution error and risk bound for this classic problem. The algorithm sketches the covariance matrix by variants of Frequent Directions, which implies it can operate in insertion-only streams and a variety of distributed data settings. In comparisons to randomized sketching algorithms on synthetic and real-world datasets, our algorithm has less empirical error using less space and similar time.
Introduction
In the era of big data, we often face "tall" matrices where the number of observations ($n$) far exceeds the number of features ($d$). Standard ridge regression requires $O(nd^2)$ time and $O(nd)$ space. While we can process this in a stream using $O(d^2)$ space to maintain a covariance matrix, $d^2$ becomes prohibitively large as dimensionality increases.
Existing solutions usually rely on randomized sketching (like Random Projections or CountSketch). While useful, these methods require a large number of dimensions to provide high-accuracy guarantees, often needing $O(d/\epsilon^2)$ space. Furthermore, being randomized, they carry a small risk of failure. This research introduces a deterministic way to sketch data for ridge regression that uses even less space ($o(d^2)$) while maintaining provable accuracy.
Methodology: Frequent Directions for Ridge Regression
The proposed solution builds on Frequent Directions (FD), a deterministic matrix sketching algorithm that acts like a "streaming SVD."
- The Core Algorithm (FDRR): The algorithm processes data in batches. It uses FD to maintain a small sketch matrix $B$ (of size $\ell \times d$, where $\ell \ll d$) that approximates the covariance of the input matrix $A$. Simultaneously, it exactly maintains the vector $c = A^T b$ in $O(d)$ space.
- The Ridge Regression Synergy: The central insight is that ridge regression is a perfect partner for FD. FD is excellent at capturing the "head" (top singular values) of a matrix but drops the "tail" (low-norm directions). Ordinarily, losing the tail is disastrous for regression. However, ridge regression adds a regularization term ($\gamma I$) that effectively "fills in" the tail, ensuring that even the directions FD ignores have a minimum norm of $\gamma$.
- Robust Frequent Directions (RFD): The authors also adapt a "Robust" version of FD that tracks the amount of energy discarded during sketching and adds it back into the regularization term, further improving accuracy.
Experimental Evaluation
The researchers evaluated their algorithms against several baselines using three primary datasets:
- Synthetic Low Rank (LR): Data where only 10% of the features are significant.
- Synthetic High Rank (HR): Data where 50% of the features are significant, providing a more challenging test for sketching.
- TEMP (Temperature Sequence): A real-world dataset consisting of hourly temperature records from 1997 to 2019, modeled as an autoregressive process.
Key Results and Insights
Space and Accuracy
The algorithm achieves $(1 \pm \epsilon)$ relative error using $O(d/\epsilon)$ space. This is the first deterministic algorithm to break the $d^2$ space barrier for this problem. In tests on high-rank data, the FD-based algorithms (FDrr and RFDrr) showed significantly less coefficient error than Random Projections (RPrr) and CountSketch (CSrr) for the same amount of memory.
Computational Efficiency
While FD is computationally heavier than random projections during the update step, its total time (training + query) becomes superior as $d$ grows. Because the FD sketch maintains a partial Singular Value Decomposition (SVD), calculating the final regression coefficients is extremely fast. The query phase is linear in $d$, whereas standard methods are cubic ($O(d^3)$).
Theoretical Conditions
The theoretical guarantees are strongest when the regularization parameter $\gamma$ is larger than the "tail" of the matrix (the singular values discarded by the sketch). This identifies exactly when sketching is most effective. If $\gamma$ is very small (approaching standard least squares), the error from the discarded "tail" could become significant.
Conclusion
By adapting Frequent Directions for ridge regression, this work provides a space-efficient, deterministic alternative to randomized sketching. While the paper focuses on insertion-only streams, the FD framework can be extended to distributed settings. Future work may explore "deletable" streams or further optimize update times for extremely high-dimensional sparse data.
Summary updated