gemseo.mlearning.linear_model_fitting.spgl1_settings module#

Settings for the SPGL1 (Spectral Projected Gradient for L1 minimization) algorithm.

Settings SPGL1_Settings(*, fit_intercept=True, tau=0.0, sigma=0.0, x0=None, verbosity=0, iter_lim=None, n_prev_vals=3, bp_tol=1e-06, ls_tol=1e-06, opt_tol=0.0001, dec_tol=0.0001, step_min=1e-16, step_max=100000.0, active_set_niters=inf, subspace_min=False, iscomplex=False, max_matvec=inf, weights=None, project=<function _norm_l1_project>, primal_norm=<function _norm_l1_primal>, dual_norm=<function _norm_l1_dual>)[source]#

Bases: BaseLinearModelFitter_Settings

Settings for the SPGL1 (Spectral Projected Gradient for L1 minimization) algorithm.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
Return type:

None

active_set_niters: PositiveInt | Literal[inf] = inf#

The maximum number of iterations where no change in support is tolerated. Exit with EXIT_ACTIVE_SET if no change is observed for activeSetIt iterations

bp_tol: PositiveFloat = 1e-06#

The tolerance for identifying a basis pursuit solution.

Constraints:
  • gt = 0

dec_tol: PositiveFloat = 0.0001#

The required relative change in primal objective for Newton. Larger decTol means more frequent Newton updates.

Constraints:
  • gt = 0

dual_norm: Callable[[ndarray, float | ndarray], float] = <function _norm_l1_dual>#

The primal norm evaluation function.

iscomplex: bool = False#

Whether the problem has complex variables.

iter_lim: PositiveInt | None = None#

The maximum number of iterations (default if 10*m).

ls_tol: PositiveFloat = 1e-06#

The tolerance for least-squares solution. Iterations are stopped when the ratio between the dual norm of the gradient and the L2 norm of the residual becomes smaller or equal to ls_tol.

Constraints:
  • gt = 0

max_matvec: PositiveInt | Literal[inf] = inf#

The maximum matrix-vector multiplies allowed.

n_prev_vals: PositiveInt = 3#

The line-search history length.

Constraints:
  • gt = 0

opt_tol: PositiveFloat = 0.0001#

The optimality tolerance. More specifically, when using basis pursuit denoise, the optimality condition is met when the absolute difference between the L2 norm of the residual and the sigma is smaller than``opt_tol``.

Constraints:
  • gt = 0

primal_norm: Callable[[ndarray, float | ndarray], float] = <function _norm_l1_primal>#

The primal norm evaluation function.

project: Callable[[ndarray, float | ndarray, float], ndarray] = <function _norm_l1_project>#

The projection function.

sigma: NonNegativeFloat = 0.0#

The BPDN threshold. If 0 and sigma is 0, spgl1 solves a BP problem. If different from 0, spgl1 solves a BPDN problem. tau and sigma cannot both be positive.

Constraints:
  • ge = 0

step_max: PositiveFloat = 100000.0#

The maximum spectral step.

Constraints:
  • gt = 0

step_min: PositiveFloat = 1e-16#

The minimum spectral step.

Constraints:
  • gt = 0

subspace_min: bool = False#

Subspace minimization.

tau: NonNegativeFloat = 0.0#

The Lasso threshold. If 0 and sigma is 0, spgl1 solves a BP problem. If different from 0, spgl1 solves a Lasso problem. tau and sigma cannot both be positive.

Constraints:
  • ge = 0

verbosity: Literal[0, 1, 2] = 0#

The verbosity level: 0=quiet, 1=some output, 2=more output.

weights: float | ndarray | None = None#

The weights W in ||Wx||_1. If None, use 1.

x0: ndarray | None = None#

The initial guess of x; if None zeros are used.