skglm.penalties.L2#
- class skglm.penalties.L2(alpha)[source]#
`ell_2` penalty.
The penalty reads
`\alpha / 2 ||w||_2^2`Methods
__init__(alpha)generalized_support(w)Return a mask which is True for coefficients in the generalized support.
get_spec()Specify the numba types of the class attributes.
gradient(w)Compute the gradient of the L2 penalty.
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.
value(w)Compute the value of the L2 penalty.