Skip to content

Instantly share code, notes, and snippets.

@maximsch2
Created September 28, 2012 04:37
Show Gist options
  • Save maximsch2/3797934 to your computer and use it in GitHub Desktop.
Save maximsch2/3797934 to your computer and use it in GitHub Desktop.
[BUG] Bug in scikit-learn.linear_model.Lasso in v 0.12
# 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