glassbox.models.linear_model.linear¶
LinearRegression model.
LinearRegression
¶
Bases: BaseLinearModel
Linear regression model.
Source code in glassbox/models/linear_model/_base.py
fit
¶
Fit the linear regression model to training data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Training feature matrix of shape (n_samples, n_features). |
required |
y
|
ndarray
|
Training target vector of shape (n_samples,). |
required |
Returns:
| Type | Description |
|---|---|
Self
|
The fitted model instance. |
Source code in glassbox/models/linear_model/linear.py
predict
¶
Predict continuous target values for input samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Input feature matrix of shape (n_samples, n_features). |
required |
**kwargs
|
Any
|
Additional keyword arguments for prediction. |
{}
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Predicted values of shape (n_samples,). |