LazyMatrix
rust
python
LazyMatrix centers and scales dense, sparse, and chunked Zarr matrices through matrix operations, preserving sparsity without creating a normalized copy.
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},
title = {LazyMatrix: {Lazy} Representations of Normalized Matrices},
version = {v0.1.0},
date = {2026-10-26},
url = {https://lazymatrix.org},
doi = {10.5281/zenodo.23666452},
langid = {en}
}
For attribution, please cite this work as:
Larsson, Johan. 2026. LazyMatrix: Lazy Representations of Normalized
Matrices. V. v0.1.0. Released October 26. https://doi.org/10.5281/zenodo.23666452.