gemseo.mlearning.linear_model_fitting.linear_regression_settings module#

Settings for the linear regression algorithm.

Settings LinearRegression_Settings(*, fit_intercept=True, copy_X=True, n_jobs=None, positive=False, tol=1e-06)[source]#

Bases: BaseLinearModelFitter_Settings

Settings for the scikit-learn linear regression 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.

  • n_jobs (Annotated[int, Gt(gt=0)] | None)

  • positive (bool) --

    By default it is set to False.

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

    By default it is set to 1e-06.

Return type:

None

copy_X: bool = True#

If True, input data will be copied; else, it may be overwritten

n_jobs: PositiveInt | None = None#

The number of jobs to use for the computation. This will only provide speedup in case of sufficiently large problems, that is if firstly n_targets > 1 and secondly X is sparse or if positive is set to True. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors.

positive: bool = False#

When set to True, forces the coefficients to be positive. This option is only supported for dense arrays.

tol: NonNegativeFloat = 1e-06#

The precision of the solution is determined by tol which specifies a different convergence criterion for the lsqr solver. tol is set as atol and btol of scipy.sparse.linalg.lsqr when fitting on sparse training data. This parameter has no effect when fitting on dense data.

Constraints:
  • ge = 0