Expand description
Linear regression: ordinary least squares (OLS) and ridge (L2) regression.
Both estimators fit a coefficient vector β and an intercept by the normal
equations. OLS minimises ‖y − Xβ‖²; ridge adds an L2 penalty λ‖β‖² on the
slopes (the intercept is left unpenalised, matching scikit-learn’s Ridge).
The fit centres the design and target, solves (X_cᵀX_c + λI)β = X_cᵀy_c for
the centred slopes by Gaussian elimination with partial pivoting, and recovers
the intercept from the column means. This base block backs RegressionMethod.
Structs§
- Linear
Model - A fitted linear model: an intercept plus one slope per predictor column.
Enums§
- Regression
Error - Errors that prevent a linear model from being fitted.