L2 penalized least squares linear regression solved using the closed-form equation. The addition of regularization controlled by the alpha parameter makes Ridge less prone to overfitting than ordinary least squares linear regression.

Interfaces: Estimator, Learner, Persistable

Data Type Compatibility: Continuous


# Param Default Type Description
1 alpha 1.0 float The L2 regularization penalty amount to be added to the weight coefficients.

Additional Methods#

Return the weights of the model:

public weights() : array|null

Return the bias parameter:

public bias() : float|null


use Rubix\ML\Regressors\Ridge;

$estimator = new Ridge(2.0);