lazymatrix.RowNormalizationParams
LazyMatrix for Python · 0.5.0
Bases: _NormalizationParams
RowNormalizationParams(
nrows: int,
*,
centers: typing.Any = None,
scales: typing.Any = None
)Float64 centers and scales for particular rows, independent of storage.
Parameters
nrows : int
Nonnegative number of rows, retained when both components are None.
centers : array-like or None, default=None
One real value per row. Copied without changing nonfinite values.
scales : array-like or None, default=None
One real, nonzero value per row. Negative and nonfinite values are preserved. Positive and negative zero raise ValueError with the row index, including values that round to zero in float64.
Notes
Obtain fitted values from an axis=1 matrix’s normalization property or RowNormalization.fit. Arrays returned by properties are independent copies. These parameters describe the fitted rows in their original order. Fit new samples independently with RowNormalization.fit_apply or a new axis=1 LazyMatrix, even when their row count matches the training data.
Save nrows and active centers and scales arrays with numpy.savez, then reconstruct this class and use apply_frozen to restore the same rows. Omitted arrays mean None, preserving inactive components’ IEEE semantics.
__init__ {#init}
__init__(
nrows: int,
*,
centers: typing.Any = None,
scales: typing.Any = None
) -> Nonenrows
nrows(self) -> intThe number of rows described by these parameters.
centers
centers(
self
) -> numpy.ndarray[tuple[typing.Any, ...], numpy.dtype[numpy.float64]] | NoneAn independent copy of row centers, or None when inactive.
scales
scales(
self
) -> numpy.ndarray[tuple[typing.Any, ...], numpy.dtype[numpy.float64]] | NoneAn independent copy of row scales, or None when inactive.
apply_frozen
apply_frozen(X: typing.Any) -> lazymatrix.LazyMatrixApply saved values unchanged to the same rows in the same order.
X must have nrows rows; its column count may differ. The input is copied following LazyMatrix’s storage rules. A row-count mismatch raises ValueError. This method performs no fitting.

