lazymatrix.NormalizationParams
LazyMatrix for Python · 0.2.0
NormalizationParams(
ncols: int,
*,
centers: typing.Any = None,
scales: typing.Any = None
)Reusable float64 column centers and scales, independent of raw storage.
Parameters
ncols : int
Nonnegative number of columns, retained even when both components are None.
centers : array-like or None, default=None
One real value per column. Copied without changing nonfinite values.
scales : array-like or None, default=None
One real, nonzero value per column. Negative and nonfinite values are preserved. Positive and negative zero raise ValueError with the column index, including values that round to zero in float64.
Notes
Obtain fitted parameters with Z.normalization. Reconstruct Rust's NormalizationParams::from_parts(ncols, centers, scales) using the same values and None components. Arrays returned by properties are independent copies. Parameters never update when transformed data changes.
A portable checkpoint consists of an integer ncols and optional one-dimensional float64 centers and scales arrays in feature order. For example, save ncols and only active arrays with numpy.savez, and load with allow_pickle=False. Omitted arrays mean None; do not replace them with zeros or ones because inactive components have different IEEE semantics. This preserves NaN and infinity without nonstandard JSON values.
__init__ {#init}
__init__(
ncols: int,
*,
centers: typing.Any = None,
scales: typing.Any = None
) -> Nonencols
ncols(self) -> intThe number of columns expected by these parameters.
centers
centers(self) -> NDArray[np.float64] | NoneAn independent copy of column centers, or None when inactive.
scales
scales(self) -> NDArray[np.float64] | NoneAn independent copy of column scales, or None when inactive.
transform
transform(X: typing.Any) -> "LazyMatrix"Wrap new raw data using these parameters without fitting statistics.
X must have ncols columns. Input ownership, supported storage, and lazy operations follow LazyMatrix. A column-count mismatch raises ValueError.

