ridge regression python sklearn code example
Example 1: scikit learn ridge regression
from sklearn.linear_model import Ridge
clf = Ridge(alpha=1.0)
clf.fit(X, y) #Fit Ridge regression model
clf.predict(y) #Predict using the model
Example 2: ridge regression implementation python
from sklearn.linear_model import Ridge
X_train, X_test, y_train, y_test = train_test_split(X_crime, y_crime,
random_state = 0)
linridge = Ridge(alpha=20.0).fit(X_train, y_train)