gemseo.mlearning.linear_model_fitting.elastic_net_settings module#

Settings for the scikit-learn elastic net algorithm.

Settings ElasticNet_Settings(*, fit_intercept=True, copy_X=True, max_iter=1000, positive=False, precompute=False, random_state=None, selection='cyclic', tol=0.0001, alpha=1.0, l1_ratio=0.5, warm_start=False)[source]#

Bases: _ElasticNetMixin, BaseLinearModelFitter_Settings

Settings for the scikit-learn elastic net 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.

  • copy_X (bool) --

    By default it is set to True.

  • max_iter (Annotated[int, Gt(gt=0)]) --

    By default it is set to 1000.

  • positive (bool) --

    By default it is set to False.

  • precompute (bool | ndarray) --

    By default it is set to False.

  • random_state (int | RandomState | None)

  • selection (Literal['cyclic', 'random']) --

    By default it is set to "cyclic".

  • tol (Annotated[float, Gt(gt=0)]) --

    By default it is set to 0.0001.

  • alpha (Annotated[float, Ge(ge=0)]) --

    By default it is set to 1.0.

  • l1_ratio (Annotated[float, Le(le=1.0), Ge(ge=0)]) --

    By default it is set to 0.5.

  • warm_start (bool) --

    By default it is set to False.

Return type:

None

alpha: NonNegativeFloat = 1.0#

The constant \(\alpha\) that multiplies the L1 and 2 terms, controlling regularization strength.

Constraints:
  • ge = 0

l1_ratio: NonNegativeFloat = 0.5#

The ElasticNet mixing parameter \(\rho\). For l1_ratio = 0, the penalty is an L2 penalty. For l1_ratio = 1, it is an L1 penalty. For 0 < l1_ratio < 1, the penalty is a combination of L1 and L2.

Constraints:
  • le = 1.0

  • ge = 0

warm_start: bool = False#

When set to True, reuse the solution of the previous call to fit as initialization, otherwise, just erase the previous solution.