sklearn.linear model.Ridge
Jump to navigation
Jump to search
A sklearn.linear model.Ridge is a ridge regression system within sklearn.linear_model
class.
- Context
- Usage:
- 1) Import Linear Regression model from scikit-learn :
from sklearn.linear_model import Ridge
- 2) Create design matrix
X
and response vectorY
- 3) Create Lasso Regression object:
model=Ridge(alpha=alpha[,fit_intercept=True, normalize=False,...])
- 4) Choose method(s):
- Fit Ridge regression model:
model.fit(X, Y[, check_input]))
- Predict Y using the linear model with estimated coefficients:
Y_pred = model.predict(X)
- Return coefficient of determination (R^2) of the prediction:
model.score(X,Y[, sample_weight=w])
- Get estimator parameters:
model.get_params([deep])
- Set estimator parameters:
model.set_params(**params)
- Fit Ridge regression model:
- 1) Import Linear Regression model from scikit-learn :
- Example(s):
- Counter-Example(s)
- See: Ridge Regression Task, Regularization Task, Estimation Task, L2-Norm.
References
2017
- http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html
- QUOTE:
class sklearn.linear_model.Ridge(alpha=1.0, fit_intercept=True, normalize=False, copy_X=True, max_iter=None, tol=0.001, solver=’auto’, random_state=None)
Linear least squares with l2 regularization.
This model solves a regression model where the loss function is the linear least squares function and regularization is given by the l2-norm. Also known as Ridge Regression or Tikhonov regularization. This estimator has built-in support for multi-variate regression (i.e., when y is a 2d-array of shape [n_samples, n_targets]).
- QUOTE: