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_SettingsSettings 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:
fit_intercept (bool) --
By default it is set to True.
tau (Annotated[float, Ge(ge=0)]) --
By default it is set to 0.0.
sigma (Annotated[float, Ge(ge=0)]) --
By default it is set to 0.0.
x0 (ndarray | None)
verbosity (Literal[0, 1, 2]) --
By default it is set to 0.
n_prev_vals (Annotated[int, Gt(gt=0)]) --
By default it is set to 3.
bp_tol (Annotated[float, Gt(gt=0)]) --
By default it is set to 1e-06.
ls_tol (Annotated[float, Gt(gt=0)]) --
By default it is set to 1e-06.
opt_tol (Annotated[float, Gt(gt=0)]) --
By default it is set to 0.0001.
dec_tol (Annotated[float, Gt(gt=0)]) --
By default it is set to 0.0001.
step_min (Annotated[float, Gt(gt=0)]) --
By default it is set to 1e-16.
step_max (Annotated[float, Gt(gt=0)]) --
By default it is set to 100000.0.
active_set_niters (Annotated[int, Gt(gt=0)] | Literal[inf]) --
By default it is set to inf.
subspace_min (bool) --
By default it is set to False.
iscomplex (bool) --
By default it is set to False.
max_matvec (Annotated[int, Gt(gt=0)] | Literal[inf]) --
By default it is set to inf.
project (Callable[[ndarray, float | ndarray, float], ndarray]) --
By default it is set to <function _norm_l1_project at 0x7c2f91182200>.
primal_norm (Callable[[ndarray, float | ndarray], float]) --
By default it is set to <function _norm_l1_primal at 0x7c2f911820c0>.
dual_norm (Callable[[ndarray, float | ndarray], float]) --
By default it is set to <function _norm_l1_dual at 0x7c2f91182160>.
- 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
activeSetItiterations
- 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
decTolmeans more frequent Newton updates.- Constraints:
gt = 0
- dual_norm: Callable[[ndarray, float | ndarray], float] = <function _norm_l1_dual>#
The primal norm evaluation function.
- 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
sigmais 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
0andsigmais0, spgl1 solves a BP problem. If different from0, spgl1 solves a BPDN problem.tauandsigmacannot 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
- tau: NonNegativeFloat = 0.0#
The Lasso threshold. If
0andsigmais0, spgl1 solves a BP problem. If different from0, spgl1 solves a Lasso problem.tauandsigmacannot both be positive.- Constraints:
ge = 0
- verbosity: Literal[0, 1, 2] = 0#
The verbosity level: 0=quiet, 1=some output, 2=more output.