skglm.penalties.IndicatorBox#
- class skglm.penalties.IndicatorBox(alpha)[source]#
Box constraint penalty.
Notes
`bb"1"_([0, alpha]^(n_"samples"))`where `bb"1"` is the indicator function of the convex set `[0, alpha]^(n_"samples")`
Methods
__init__(alpha)generalized_support(w)Return a mask with coefficients that are neither 0 nor alpha.
get_spec()Specify the numba types of the class attributes.
is_penalized(n_features)Return a binary mask with the penalized features.
params_to_dict()Get the parameters to initialize an instance of the class.
prox_1d(value, stepsize, j)Compute the proximal operator of the Indicator Box (box projection).
subdiff_distance(w, grad, ws)Compute distance of negative gradient to the subdifferential at w.
value(w)Compute the value of the IndicatorBox at w.