Masked
Masked excludes selected coefficients from a supported penalty. Let be one for penalized coordinates and zero for excluded coordinates. Then
In the Rust mask, true means unpenalized, while false retains the penalty. The mask has one entry per coefficient and never includes intercepts.
Constraint region
Masked::new(vec![true, false], L1::new(1.0)) gives . The first coordinate is free, so the region is unbounded horizontally. See the plot conventions.
Use the wrapper
use ;
The proximal map copies excluded inputs unchanged and solves the restricted penalty exactly. L1, ridge, and elastic net implement the required RestrictedProximalPenalty capability. Scaled preserves it. Coupled penalties cannot be masked merely by restoring coefficients after an unrestricted prox.
Use proximal gradient and compose the wrapper inside AxisPenalty when needed. The wrapper does not supply the coordinate capability required by IRLS.
API: shrinkage::Masked and shrinkage::RestrictedProximalPenalty.
