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 a el0ps.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. If None, the values considered is computed from the other parameters lmbd_max, lmbd_min, lmbd_num, lmbd_normalized, and lmbd_spacing.

lmbd_maxfloat = 1e-0

Maximum value of lmbd to consider. If lmbds is not None, this parameter is ignored.

lmbd_minfloat = 1e-2

Minimum value of lmbd to consider. If lmbds is not None, this parameter is ignored.

lmbd_numint = 10

Number of values of lmbd to consider. If lmbds is not None, this parameter is ignored.

lmbd_scalestr = “log”

Scale of the values of lmbd to consider. Can be linear or log. If lmbds is not None, this parameter is ignored.

lmbd_normalizedbool = True

If True, the values of lmbd considered are scaled by the value outputted by the function el0ps.utils.compute_lmbd_max() so that the solution to the problem is the all-zero vector for the largest value of lmbd specified in the regularization path. If lmbds 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 of lmbd. When None, 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.