el0ps.estimator.L0Estimator

class el0ps.estimator.L0Estimator(datafit, penalty, lmbd, fit_intercept=False, solver=<el0ps.solver.bnb.BnbSolver object>)

Scikit-learn-compatible linear model estimators based on L0-regularized problems.

The estimator corresponds to a solution of the problem

\[\textstyle\min_{\mathbf{x} \in \mathbb{R}^{n}} f(\mathbf{Ax}) + \lambda\|\mathbf{x}\|_0 + h(\mathbf{x})\]

where \(f\) is a datafit function, \(\mathbf{A} \in \mathbb{R}^{m \times n}\) is a matrix, \(\lambda > 0\) is a parameter, the L0-norm \(\|\cdot\|_0\) counts the number of non-zero entries in its input, and \(h\) is a penalty function.

Parameters:
datafit: BaseDatafit

Datafit function.

penalty: BasePenalty

Penalty function.

lmbd: float

L0-norm weight.

fit_intercept: bool, default=False

Whether to fit an intercept term.

solver: BaseSolver, default=BnbSolver()

Solver for the estimator associated problem.

__init__(datafit, penalty, lmbd, fit_intercept=False, solver=<el0ps.solver.bnb.BnbSolver object>)

Methods

__init__(datafit, penalty, lmbd[, ...])

fit(X, y)

Fit model.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

predict(X)

Predict using the linear model.

set_params(**params)

Set the parameters of this estimator.