1.2.8 Standardization and the intercept🔗ℹ

By default each predictor is scaled to unit variance before fitting and the coefficients are reported on the original scale, which is also the R package’s default. The penalty acts on the standardized coefficients, so predictors measured in different units are penalized evenly. Pass #:standardize? #f to penalize the raw coefficients instead; a penalized fit then changes:

> (elnet-result-coefficients (ridge X y #:lambda 0.1))

'#(1.5916761644299766 -0.6843296627955713)

> (elnet-result-coefficients (ridge X y #:lambda 0.1 #:standardize? #f))

'#(1.7885073496463082 -0.8405933126430131)

Every family except Cox fits an unpenalized intercept. Pass #:intercept? #f to force it to zero:

> (elnet-result-intercept (ols X y #:intercept? #f))

0.0

> (elnet-result-coefficients (ols X y #:intercept? #f))

'#(2.2329448274899724 -0.9622848484002787)