tick.prox.
ProxSlope
(strength: float, fdr: float = 0.6, range: tuple = None, positive: bool = False)[source]¶Proximal operator of Slope penalization. This penalization is particularly relevant for feature selection, in generalized linear models, when features correlation is not too high.
strength : float
Level of penalization
fdr : float
, default=0.6
Desired False Discovery Rate for detection of non-zeros in the coefficients. Must be between 0 and 1.
range : tuple
of two int
, default=`None`
Range on which the prox is applied. If
None
then the prox is applied on the whole vector
weights : np.array
, shape=(n_coeffs,)
The weights used in the penalization. They are automatically setted, depending on the
weights_type
andfdr
parameters.
dtype : {'float64', 'float32'}
Type of the arrays used.
Notes
Uses the stack-based algorithm for FastProxL1 from
SLOPE–Adaptive Variable Selection via Convex Optimization, by Bogdan, M. and Berg, E. van den and Sabatti, C. and Su, W. and Candes, E. J. arXiv preprint arXiv:1407.3824, 2014
__init__
(strength: float, fdr: float = 0.6, range: tuple = None, positive: bool = False)[source]¶Initialize self. See help(type(self)) for accurate signature.
call
(coeffs, step=1.0, out=None)¶Apply proximal operator on a vector. It computes:
coeffs : numpy.ndarray
, shape=(n_coeffs,)
Input vector on which is applied the proximal operator
step : float
or np.array
, default=1.
The amount of penalization is multiplied by this amount
If
float
, the amount of penalization is multiplied by this amountIf
np.array
, then each coordinate of coeffs (within the given range), receives an amount of penalization multiplied by t (available only for separable prox)
out : numpy.ndarray
, shape=(n_params,), default=None
If not
None
, the output is stored in the givenout
. Otherwise, a new vector is created.
output : numpy.ndarray
, shape=(n_coeffs,)
Same object as out
Notes
step
must have the same size as coeffs
whenever range is
None
, or a size matching the one given by the range
otherwise
tick.prox.ProxSlope
¶