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.BaseDatafitfunction, \(\mathbf{A} \in \mathbb{R}^{m \times n}\) is a matrix, \(h\) is ael0ps.penalty.BasePenaltyfunction, 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
lmbdto 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
lmbdto consider. Iflmbdsis notNone, this parameter is ignored.- lmbd_minfloat = 1e-2
Minimum value of
lmbdto consider. Iflmbdsis notNone, this parameter is ignored.- lmbd_numint = 10
Number of values of
lmbdto consider. Iflmbdsis notNone, this parameter is ignored.- lmbd_scalestr = “log”
Scale of the values of
lmbdto consider. Can belinearorlog. Iflmbdsis notNone, this parameter is ignored.- lmbd_normalizedbool = True
If
True, the values oflmbdconsidered 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 oflmbdspecified in the regularization path. Iflmbdsis not None, this value is ignored.- max_nnzint = sys.maxsize
Stop the path fitting when a solution with more than
max_nnznon-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
lmbdis 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.