Permalink
Browse files

BUG: change alpha scaling in LassoLARS

  • Loading branch information...
1 parent 45f38b2 commit 2c1c88b6e7a4e1fd19e40af59a2491a16ef8f555 @GaelVaroquaux GaelVaroquaux committed Jun 18, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 doc/modules/linear_model.rst
  2. +2 −2 scikits/learn/linear_model/least_angle.py
@@ -244,7 +244,7 @@ function of the norm of its coefficients.
LassoLARS(normalize=True, verbose=False, fit_intercept=True, max_iter=500,
precompute='auto', alpha=0.1)
>>> clf.coef_
- array([ 0.30710678, 0. ])
+ array([ 0.50710678, 0. ])
.. topic:: Examples:
@@ -392,7 +392,7 @@ def fit(self, X, y, max_features=None, overwrite_X=False, **params):
n_samples = X.shape[0]
if self.method == 'lasso':
- alpha = self.alpha * n_samples # scale alpha with nb of samples
+ alpha = self.alpha
else:
alpha = 0.
@@ -471,7 +471,7 @@ class LassoLARS (LARS):
LassoLARS(normalize=True, verbose=False, fit_intercept=True, max_iter=500,
precompute='auto', alpha=0.01)
>>> print clf.coef_
- [ 0. -0.72649658]
+ [ 0. -0.78649658]
References
----------

1 comment on commit 2c1c88b

@fabianp
Member

I kind of remember adding this for compatibility with Lasso CD ... however I must be wrong, I added a test and it works. Thanks!

Please sign in to comment.