Cosmetic changes to rigde path example
Change the name of ridge object clf to ridge and also
reinstantiate ridge in every iteration.
Issue:
@@ -44,13 +44,12 @@ y = np.ones(10)
n_alphas = 200
alphas = np.logspace(-10, -2, n_alphas)
-clf = linear_model.Ridge(fit_intercept=False)
coefs = []
for a in alphas:
- clf.set_params(alpha=a)
- clf.fit(X, y)
- coefs.append(clf.coef_)
+ ridge = linear_model.Ridge(alpha=a, fit_intercept=False)
+ ridge.fit(X, y)
+ coefs.append(ridge.coef_)
###############################################################################
# Display results
