lale.lib.sklearn.linear_regression module

class lale.lib.sklearn.linear_regression.LinearRegression(*, fit_intercept=True, copy_X=True, n_jobs=None, positive=False)

Bases: PlannedIndividualOp

Linear regression linear model from scikit-learn for classification.

This documentation is auto-generated from JSON schemas.

Parameters
  • fit_intercept (boolean, default True) – Whether to calculate the intercept for this model.

  • copy_X (boolean, default True) – If True, X will be copied; else, it may be overwritten.

  • n_jobs (union type, optional, not for optimizer, default None) –

    The number of jobs to run in parallel.

    • None

      1 unless in joblib.parallel_backend context.

    • or -1

      Use all processors.

    • or integer, >=1

      Number of CPU cores.

  • positive (boolean, optional, not for optimizer, default False) –

    When set to True, forces the coefficients to be positive.

    See also constraint-1.

Notes

constraint-1 : union type

Setting positive=True is only supported for dense arrays.

  • positive : False

  • or negated type of ‘X/isSparse’

fit(X, y=None, **fit_params)

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (array of items : array of items : float) – Features; the outer array is over samples.

  • y (union type) –

    Target values. Will be cast to X’s dtype if necessary

    • array of items : array of items : float

    • or array of items : float

  • sample_weight (union type, optional) –

    Sample weights.

    • array of items : float

    • or None

      Samples are equally weighted.

predict(X, **predict_params)

Make predictions.

Note: The predict method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array, optional of items : array of items : float) – Samples.

Returns

result – Returns predicted values.

  • array of items : array of items : float

  • or array of items : float

Return type

union type