-
-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[MRG] ENH: MultiTaskElasticNet (and Lasso) CV #2598
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
Conversation
cc @agramfort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MultiTaskElasticNetCV should work with all task jointly. It does not make sense to loop over tasks.
Hi, @agramfort I have my exams coming up, and would be busy for the next 15 - 20 days, and I'm afraid I cannot contribute much to this right now. Is there any deadline before which I should get this merged? |
no deadline. Let's finish this after your exams. |
@agramfort : I had some free time and I managed to make a few changes, I also added a enet_multitask_path which would give the alphas for all the multitasks directly. Do have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems wrong. Can't you avoid the for loop?
@agramfort : Would you be able to have a look at the latest commits? I have resumed work on this. |
ping @agramfort |
There are some test failures. I shall attempt to rectify them first |
@agramfort : Could you please review this for me? There seems to be only one test failure, due to safe_sparse_dot of a 3-D np array. I hope I'm not troubling you too much, but I just want to finish work on this one. |
I think it would be interesting to have the |
I think that should work but only for dense data (for sparse data, MultiTaskElasticNet would need to support sparse Y). There is nothing fancy about coordinate descent for NMF but a dedicated implementation can make things much faster (e.g., by maintaining temporary matrices for computing the gradient faster). |
@agramfort : I've taken care of all test failures. Any updates on this? |
I am looking at it now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to me you don't need this param. If y.ndim == 2 then you're in a multi_output case
please start to add tests. I'll continue reviewing afterwards. thanks |
@agramfort : Thanks for the reviews 👍 |
@agramfort : I've added a few tests. I believe my work for this PR is done. Do you see any major changes to be made? |
@agramfort : Do I need to add docs to the .rst file as well? |
Ok fair enough |
Tests pass :) |
In test_common.py I remember adding a separate conditional branch for estimators that need 2d Ys (specifically it was for PLS & CCA). Couldn't you get this estimator to follow that code path? Or am I misreading the latest comments? |
@vene , @agramfort Well. I personally thought even if y is 1-D , it should be converted to 2-D y for testing. Please tell me if the latest commit looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!!
l1_ratio does not make sense for the Lasso ! how can this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also when fitting as MultiTaskLassoCV I see that it has the l1_ratio + l1_ratio_ attributes. We should avoid this:
In [38]: c = MultiTaskLassoCV().fit(X, Y)
In [39]: c.l1
c.l1_ratio c.l1_ratio_
@agramfort : I've fixed it by removing the l1_ratio parameter given in the init. It inherits from LinearModelCV and l1_ratio is now set internally in LinearModelCV |
+1 for merge on my side. Thanks @manoj-kumar-s an external review maybe @GaelVaroquaux @fabianp @mblondel @ogrisel @jnothman ? |
@agramfort . Doesn't the earlier +1 by @jnothman still hold (#2598 (comment)) ;) |
@agramfort Can this be merged? @jnothman I understand that you are busy, but all that i need is a +1. :) |
It's fine, Manoy. But three reminders in 12 hours really isn't. I'll merge via squash soon, but everything needs its time and space. |
I'm sorry. I just got a bit hyped because this was my first big PR. I promise to be really patient. |
Thanks and congratulations, Manoj! It's merged as a917a02. |
Thanks a lot guys :) @agramfort : Really quick question. Hope you wouldn't mind. |
On Tue, Jan 21, 2014 at 12:09:07AM -0800, Manoj Kumar wrote:
Don't contact anybody privately, use the mailing list, but a very |
@GaelVaroquaux : Ok. Thanks. Umm.. I had written to the the mailing list regarding GMM's for which you were listed as a mentor around 4 days back ( http://sourceforge.net/mailarchive/message.php?msg_id=31860906 ) . I think you might have somehow missed it. Would you be able to reply back and guide me a bit? |
@manoj-kumar-s since you seem to have a lot of time :) maybe you can have a look at the bug of LassoCV and ElasticNetCV that don't agree on results if X is sparse or dense in case fit_intercept=True |
@agramfort Is it this one? #2526 Btw, It would be nice if someone could guide me regarding GMM's on the mailing list. Err. Do I need to be a bit more patient? |
I'll definitely have a look tonight or tomorrow... Running into some
|
I haven't missed it. I have a huge stack of things to do, and this hasn't I am sorry, but we all get a lot of requests on many fronts, and |
@GaelVaroquaux : Ok, I will continue trying to fix bugs, till you are free enough. Is that ok? |
New MultiTaskElasticNet and Lasso CV.
Do look at the discussions in
#2590
#2402
it was finally decided that having a separate MultiTaskElasticNetCV, would be more useful than multiple usage of ElasticNetCV across n_tasks