Shrinkage

Penalties

A penalty assigns a cost to optimization-scale coefficients. Intercepts are excluded, and strengths are already included in every penalty's value. All built-in strengths must be finite and nonnegative.

Penalty

Encourages

L1

Sparse individual coefficients

Ridge

Small coefficients through a squared L2 cost

Elastic net

Sparsity together with quadratic shrinkage

SLOPE

Sparsity and equal coefficient magnitudes

Group LASSO

Sparse, explicitly defined groups

Clustered lasso

Sparsity and equal signed effects

Chain fused lasso

Sparsity and adjacent equal effects

Use Scaled to multiply a complete penalty, Masked to exclude supported coordinates, and AxisPenalty to apply a vector penalty along coefficient-matrix axes.

Read the constraint plots

Each page shows the feasible region for a two-coordinate constrained problem,

min⁡β0,βF(β0,β)subject toR(β)≤t. \min_{\beta_0,\beta} F(\beta_0,\beta) \quad\text{subject to}\quad R(\beta) \leq t.

The plots fix t=1t = 1 and shade the feasible region, including its boundary. Axes have equal scales and represent optimization coefficients, not reported original-scale coefficients. Captions specify every strength, weight, and group. The intercept does not appear in these plots.

For a penalized solution, choosing t=R(β^)t = R(\widehat\beta) makes that solution optimal for the corresponding constrained problem. The budget tt is not the penalty multiplier: the appropriate correspondence depends on the data and the solution. Our fixed budget illustrates geometry rather than fitting a dataset. Zero strengths and unpenalized directions can give unbounded regions; arrows indicate continuation beyond the plotted window.

Compose supported capabilities

shrinkage::Penalty evaluates the complete cost. A compatible shrinkage::ProximalPenalty also minimizes

prox⁡sR(v)=arg⁡min⁡z{∥z−v∥222s+R(z)},s>0. \operatorname{prox}_{sR}(v) = \mathop{\arg\min}_{z}\left\{ \frac{\|z - v\|_2^2}{2s} + R(z) \right\}, \qquad s > 0.

All seven base penalties provide this exact complete proximal map and work with proximal gradient. A sum does not acquire an exact map simply because its terms have individual maps. Other solvers need additional capabilities; see the compatibility table.