skglm.penalties.MCPenalty¶
- class skglm.penalties.MCPenalty(alpha, gamma, positive=False)[source]¶
Minimax Concave Penalty (MCP), a non-convex sparse penalty.
Notes
With `x >= 0`:
`"pen"(x) = {(alpha x - x^2 / (2 gamma), if x <= alpha gamma), (gamma alpha^2 / 2 , if x > alpha gamma):}``"value" = sum_(j=1)^(n_"features") "pen"(abs(w_j))`Methods
__init__
(alpha, gamma[, positive])alpha_max
(gradient0)Return penalization value for which 0 is solution.
generalized_support
(w)Return a mask with non-zero coefficients.
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 MCP.
subdiff_distance
(w, grad, ws)Compute distance of negative gradient to the subdifferential at w.
value
(w)Value of penalty at vector w.