Module preprocess

Module preprocess 

Source
Expand description

Data preprocessing for regularized regression.

This module provides standardization utilities that match glmnet’s behavior:

  • Predictors are centered and scaled (if enabled)
  • The intercept column is not penalized, so it’s handled specially
  • Coefficients can be unstandardized back to the original scale

§Standardization Convention

The scaling factor used is sqrt(sum(x²) / n), which gives unit variance under the 1/n convention (matching glmnet).

Structs§

StandardizationInfo
Information stored during standardization, used to unstandardize coefficients.
StandardizeOptions
Options for standardization.

Functions§

predict
Computes predictions using unstandardized coefficients.
standardize_xy
Standardizes X and y for regularized regression (glmnet-compatible).
unstandardize_coefficients
Unstandardizes coefficients from the standardized space back to original scale.