LazyMatrix
rust
python
LazyMatrix centers and scales dense, sparse, and out-of-memory matrices through matrix operations, preserving sparsity without creating normalized copies
LazyMatrix is a Rust library for column normalization of design matrices. It borrows the original matrix and applies fitted centers and scales during matrix operations, avoiding a normalized copy and preserving sparse storage.
The library supports matrix-vector products, transpose products, weighted Gram matrices, and an implicit intercept column. Backends include faer, nalgebra, ndarray, sprs, and chunked Zarr arrays for matrices larger than memory. Fitted normalization parameters can be reused on new observations.
Citation
BibTeX citation:
@software{larsson2026,
author = {Larsson, Johan},
publisher = {Zenodo},
title = {LazyMatrix: {Lazy} Representations of Normalized Matrices},
date = {2026},
url = {https://lazymatrix.org},
doi = {10.5281/zenodo.23666450},
langid = {en}
}
For attribution, please cite this work as:
Larsson, Johan. 2026. LazyMatrix: Lazy Representations of Normalized
Matrices. Zenodo, released. https://doi.org/10.5281/zenodo.23666450.