Skip to main content

Module ridge

Expand description

Ridge (L2-regularised) regression.

See the book entry Linear regression.

Structs§

Ridge
Minimises ‖y - Xw - b‖² + α ‖w‖². The penalty shrinks the weights, trading a little bias for a large drop in variance when features are correlated or samples are few. The intercept is never penalised (data are centred internally). Solved in closed form through the regularised normal equations (XᵀX + αI) w = Xᵀy, which are always well posed for α > 0.