Created
September 28, 2012 04:37
-
-
Save maximsch2/3797934 to your computer and use it in GitHub Desktop.
[BUG] Bug in scikit-learn.linear_model.Lasso in v 0.12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data is here: http://dl.dropbox.com/u/226605/data.txt.bz2 | |
from pylab import * | |
from sklearn import linear_model | |
model = linear_model.Lasso(alpha=0.1) | |
data = loadtxt("data.txt") | |
X = np.delete(data, 350, 0).T | |
y = data[350, :].T | |
model.fit(X, y) | |
print model.coef_ # 1 | |
X2 = X.copy() | |
y2 = y.copy() | |
model.fit(X2, y2) | |
print model.coef_ # should be the same as #1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment