Skip to content

Commit e0d4022

Browse files
committed
ENH Match book code example
1 parent 50cbde9 commit e0d4022

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎ch07/predict10k_en.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import numpy as np
99
from sklearn.datasets import load_svmlight_file
1010
from sklearn.cross_validation import KFold
11-
from sklearn.linear_model import ElasticNet
11+
from sklearn.linear_model import ElasticNetCV
1212
from sklearn.metrics import mean_squared_error, r2_score
1313

1414
data, target = load_svmlight_file('data/E2006.train')
1515

1616
# Edit the lines below if you want to switch method:
1717
# met = LinearRegression(fit_intercept=True)
18-
met = ElasticNet(fit_intercept=True, alpha=.1)
18+
met = ElasticNetCV()
1919

2020
kf = KFold(len(target), n_folds=5)
2121
pred = np.zeros_like(target)

0 commit comments

Comments
 (0)