-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Problem fitting LassoLarsCV - broadcasting error #716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Conrad. lars_cv.fit(X, y.ravel()) `` This is a known issue, but I'm not sure if we reached a consensus on how Cheers, On 03/21/2012 03:06 PM, Conrad Lee wrote:
|
Any PR to make |
Thanks for the quick reply. However, even when I shape the labels correctly, I get another error, see the traceback here. |
Are you running mater? I cannot reproduce this. |
Sorry, what do you meany by "running mater"? I am running a version that I checked out from github today. |
I meant "master". |
Hmm, I go this working now. I think I was just not correctly following the clean/make/build/install cycle. Once I cleaned, rebuilt, and installed everything again, the problem went away. Sorry for the bother! |
Ok, I got to the bottom of this---turns out it wasn't a build problem on my end. The problem was arising because the labels were of type int32. So the you can re-create the problem with the following: from scipy import io
import numpy
from sklearn.linear_model import LassoLarsCV
matlab_dict = io.loadmat("LassoProblemData.mat")
X, y = matlab_dict["X"], matlab_dict["y"]
y = numpy.ravel(y)
y = y.astype("i4")
lars_cv = LassoLarsCV(cv=3, n_jobs=1)
lars_cv.fit(X, y) (you can download the file "LassoProblemData.mat" here) |
can you send us a PR that makes use of utils.as_float_array which would fix the pb? thanks for the bug report |
maybe you can check that the problems does not appear with all the other linear models and add a test for it :) |
I tried adding tests using #893 but I couldn't reproduce the problem there. Using your example, I get a different traceback than you posted. I get |
Sorry Andreas, I'll be away from my development machine for a few weeks, and so won't be able to check what the current error is. |
@conradlee No problem. It would be great if you had time to look into this at some point. I'll go for the other issues in the mean time ;) |
@conradlee to me it seems the example is working with current master. Could you please have a look? If you don't have this problem any more, I'll close the issue. |
@amueller I still get a problem, you can see the exception here. Remember, I'm not running the code mentioned at the beginning of this thread, but the stuff in the middle. Here's exactly what I ran:
The data comes from here. |
Ok thanks, I can reproduce. |
+1, gists are better anyway. |
On Sun, Aug 26, 2012 at 12:33:48PM -0700, Andreas Mueller wrote:
I had to fix a minor detail (in ca36d73) to get the code running on my G |
I could reproduce, but should be fixed in 06112e5. |
I guess your modification made mine obsolete? Mine is more upstream in the code, though, which I think is the place the input check should happen. |
I'm trying to follow along the example presented here on sparse feature recovery using a randomized lasso.
Part of that example requires fitting a LasoLarsCV estimator. However, when I try to fit that, I get an error, you can see the traceback here.
You can re-create this problem by downloading the data that I'm using here. Then try the following:
The text was updated successfully, but these errors were encountered: