Skip to content

lazymatrix.ColumnNormalization ​

LazyMatrix for Python · 0.5.0

Source

Bases: _Normalization

python
ColumnNormalization(
    *,
    center: Union[bool, typing.Literal["none", "mean", "min", "median"]] = True,
    scale: Union[bool, typing.Literal["none", "sd", "range", "quantile_range", "maxabs", "l1", "l2"]] = True,
    df: int = 0,
    quantile_range: tuple[float, float] = (0.25, 0.75),
    unit_variance: bool = False
)

An immutable recipe for fitting column centers and scales.

The keyword-only center, scale, df, quantile_range, and unit_variance options follow LazyMatrix with axis=0. Defaults select means and population standard deviations. fit returns ColumnNormalizationParams, and fit_apply returns a LazyMatrix. Reuse fitted column parameters on new samples with params.transform(X_new). Options are available as read-only properties.

__init__ {#init} ​

python
__init__(
    *,
    center: Union[bool, typing.Literal["none", "mean", "min", "median"]] = True,
    scale: Union[bool, typing.Literal["none", "sd", "range", "quantile_range", "maxabs", "l1", "l2"]] = True,
    df: int = 0,
    quantile_range: tuple[float, float] = (0.25, 0.75),
    unit_variance: bool = False
) -> None

Source

fit ​

python
fit(X: typing.Any) -> lazymatrix.ColumnNormalizationParams

Source

Fit column parameters without retaining the input matrix.

Input is copied temporarily using LazyMatrix’s storage rules. Only fitted centers, scales, and ncols are retained. The recipe stays unchanged.

fit_apply ​

python
fit_apply(X: typing.Any) -> lazymatrix.LazyMatrix

Source

Fit column parameters and return a lazy matrix owning its input copy.

Every call fits independently. Input storage and lazy operations follow LazyMatrix with axis=0. Reuse training column parameters on new samples with matrix.normalization.transform(X_new).

Released under the MIT and Apache 2.0 licenses.