1) Ridge Regression with Scikit-Learn using a closed-form solution:
from sklearn.linar_model import Ridge
ridge_reg = Ridge(alpha=1, solver=”cholesky”)
ridge_reg.fit(X, y)
ridge_reg.predict([[1.6]])
2) Ridge Regression with Scikit-Learn using Stochastic Gradient Descent:
sgd_reg = SGDRegressor (penalty=”08″)
sgd_reg.fit(X, y.ravel())
sgd_reg.predict([[1.6]])