el0ps.path.Path¶
- class el0ps.path.Path(lmbds=None, lmbd_max=1.0, lmbd_min=0.01, lmbd_num=10, lmbd_scale='log', lmbd_normalized=True, max_nnz=None, stop_if_not_optimal=True, verbose=True)¶
Regularization path fitting for L0-regularized problems.
The problem is expressed as
\[\textstyle\min_{\mathbf{x} \in \mathbb{R}^{n}} f(\mathbf{Ax}) + \lambda\|\mathbf{x}\|_0 + h(\mathbf{x})\]where \(f\) is a
el0ps.datafit.BaseDatafit
function, \(\mathbf{A} \in \mathbb{R}^{m \times n}\) is a matrix, \(h\) is ael0ps.penalty.BasePenalty
function, and \(\lambda\) is a positive scalar. The path fitting consists of solving this problem over a range of values of parameter \(\lambda\).- Parameters:
- lmbdslist, default=None
Values of parameter
lmbd
to consider. IfNone
, the values considered is computed from the other parameterslmbd_max
,lmbd_min
,lmbd_num
,lmbd_normalized
, andlmbd_spacing
.- lmbd_maxfloat = 1e-0
Maximum value of
lmbd
to consider. Iflmbds
is notNone
, this parameter is ignored.- lmbd_minfloat = 1e-2
Minimum value of
lmbd
to consider. Iflmbds
is notNone
, this parameter is ignored.- lmbd_numint = 10
Number of values of
lmbd
to consider. Iflmbds
is notNone
, this parameter is ignored.- lmbd_scalestr = “log”
Scale of the values of
lmbd
to consider. Can belinear
orlog
. Iflmbds
is notNone
, this parameter is ignored.- lmbd_normalizedbool = True
If
True
, the values oflmbd
considered are scaled by the value outputted by the functionel0ps.utils.compute_lmbd_max()
so that the solution to the problem is the all-zero vector for the largest value oflmbd
specified in the regularization path. Iflmbds
is not None, this value is ignored.- max_nnzint = sys.maxsize
Stop the path fitting when a solution with more than
max_nnz
non-zero coefficients is found for a given value oflmbd
. WhenNone
, this criterion is ignored.- stop_if_not_optimalbool = True
Stop the path fitting when the problem at a given value of
lmbd
is not solved to optimality.- verbosebool = True
Toggle displays during path fitting.
- __init__(lmbds=None, lmbd_max=1.0, lmbd_min=0.01, lmbd_num=10, lmbd_scale='log', lmbd_normalized=True, max_nnz=None, stop_if_not_optimal=True, verbose=True)¶
Methods
__init__
([lmbds, lmbd_max, lmbd_min, ...])fit
(solver, datafit, penalty, A)Construct the regularization path.