from sklearn.linear_model import Ridge
ridge=Ridge().fit(X_train,Y_train)
增加alpha,使得w更加倾向于0,从而提高泛化
ridge=Ridge(alpha=10).fit(X_train,Y_train)
from sklearn.linear_model import Ridge
ridge=Ridge().fit(X_train,Y_train)
增加alpha,使得w更加倾向于0,从而提高泛化
ridge=Ridge(alpha=10).fit(X_train,Y_train)