gemseo.mlearning.linear_model_fitting.elastic_net_cv_settings module#

Settings for the scikit-learn elastic net algorithm with built-in cross-validation.

Settings ElasticNetCV_Settings(*, fit_intercept=True, copy_X=True, max_iter=1000, positive=False, precompute=False, random_state=None, selection='cyclic', tol=0.0001, alphas=(0.001, 0.01, 0.1, 1.0, 10.0), l1_ratio=(0.1, 0.5, 0.7, 0.9, 0.95, 0.99, 1), cv=None)[source]#

Bases: _ElasticNetMixin, BaseLinearModelFitter_Settings

Settings for the scikit-learn elastic net algorithm with built-in cross-validation.

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.

  • alphas (tuple[Annotated[float, Ge(ge=0)], ...]) --

    By default it is set to (0.001, 0.01, 0.1, 1.0, 10.0).

  • l1_ratio (tuple[Annotated[float, Ge(ge=0)], ...]) --

    By default it is set to (0.1, 0.5, 0.7, 0.9, 0.95, 0.99, 1).

  • cv (int | None)

Return type:

None

alphas: tuple[NonNegativeFloat, ...] = (0.001, 0.01, 0.1, 1.0, 10.0)#

Values of \(\alpha\) to try. The constant \(\alpha\) multiplies the L1 and 2 terms, controlling regularization strength.

cv: int | None = None#

The number of folds. If None, use the efficient Leave-One-Out cross-validation.

l1_ratio: tuple[NonNegativeFloat, ...] = (0.1, 0.5, 0.7, 0.9, 0.95, 0.99, 1)#

Values of \(\rho\) to try. 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.