# LinearRegression

### *class* cuml.dask.linear_model.LinearRegression(, client=None, verbose=False, \*\*kwargs)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/linear_model/linear_regression.py#L16)

LinearRegression is a simple machine learning model where the response y is
modelled by a linear combination of the predictors in X.

cuML’s Dask Linear Regression (multi-node multi-GPU) expects Dask cuDF
DataFrame and provides an eigendecomposition-based algorithm (Eig) to fit
a linear model. The Eig algorithm is usually preferred when X is a tall
and skinny matrix. As the number of features in X increases, the accuracy
of the Eig algorithm may decrease.

* **Parameters:**
  **algorithm**
  : Eig uses an eigendecomposition of the covariance matrix, and is much
    faster.
    SVD is slower, but guaranteed to be stable.

  **fit_intercept**
  : LinearRegression adds an additional term c to correct for the global
    mean of y, modeling the response as “x \* beta + c”.
    If False, the model expects that you have centered the data.
* **Attributes:**
  **coef_**
  : The estimated coefficients for the linear regression model.

  **intercept_**
  : The independent term. If `fit_intercept` is False, will be 0.

### Methods

| [`fit`](#cuml.dask.linear_model.LinearRegression.fit)(X, y)             | Fit the model with X and y.                           |
|------------------------------------------------------------------------|-------------------------------------------------------|
| [`predict`](#cuml.dask.linear_model.LinearRegression.predict)(X[, delayed]) | Make predictions for X and returns a dask collection. |
<!-- !! processed by numpydoc !! -->

#### fit(X, y)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/linear_model/linear_regression.py#L51)

Fit the model with X and y.

* **Parameters:**
  **X**
  : Features for regression

  **y**
  : Labels (outcome values)

<!-- !! processed by numpydoc !! -->

#### get_combined_model()[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/common/base.py#L57)

Return single-GPU model for serialization

* **Returns:**
  **model**
  : yet been trained.

<!-- !! processed by numpydoc !! -->

#### predict(X, delayed=True)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/dask/linear_model/linear_regression.py#L70)

Make predictions for X and returns a dask collection.

* **Parameters:**
  **X**
  : Distributed dense matrix (floats or doubles) of shape
    (n_samples, n_features).

  **delayed**
  : Whether to do a lazy prediction (and return Delayed objects) or an
    eagerly executed one.
* **Returns:**
  **y**

<!-- !! processed by numpydoc !! -->
