8000 [MRG] FIX lasso/elasticnet example did not add noise to simulated dat… · scikit-learn/scikit-learn@9b75a81 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b75a81

Browse files
NelleVlesteve
authored andcommitted
[MRG] FIX lasso/elasticnet example did not add noise to simulated data. (#8427)
The first argument of np.random.normal is the mean of the distribution, and not the output shape. The example thus did not add noise but only an intercept to the model.
1 parent daeba62 commit 9b75a81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/linear_model/plot_lasso_and_elasticnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
y = np.dot(X, coef)
2929

3030
# add noise
31-
y += 0.01 * np.random.normal((n_samples,))
31+
y += 0.01 * np.random.normal(size=n_samples)
3232

3333
# Split data in train set and test set
3434
n_samples = X.shape[0]

0 commit comments

Comments
 (0)
0