Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MechCoder
Copy link
Member

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

@MechCoder
Copy link
Member Author

cc @agramfort

Copy link
Member

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.

@MechCoder
Copy link
Member Author

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?

@agramfort
Copy link
Member

no deadline. Let's finish this after your exams.

@MechCoder
Copy link
Member Author

@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.

Copy link
Member

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?

@MechCoder
Copy link
Member Author

@agramfort : Would you be able to have a look at the latest commits? I have resumed work on this.

@MechCoder
Copy link
Member Author

ping @agramfort

@MechCoder
Copy link
Member Author

There are some test failures. I shall attempt to rectify them first

@MechCoder
Copy link
Member Author

@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.

@vene
Copy link
Member

vene commented Dec 14, 2013

I think it would be interesting to have the non_negative option in order to use this as a non-negative least squares algorithm and therefore as a NMF backend. I wonder, since this is a coordinate descent solver, is this the same as coordinate descent NMF? @mblondel can you illuminate me as always? :)

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 2853022 on Manoj-Kumar-S:MultiENetCV into aa8139b on scikit-learn:master.

@mblondel
Copy link
Member

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).

@MechCoder
Copy link
Member Author

@agramfort : I've taken care of all test failures. Any updates on this?

@agramfort
Copy link
Member

I am looking at it now

Copy link
Member

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

@agramfort
Copy link
Member

please start to add tests. I'll continue reviewing afterwards. thanks

@MechCoder
Copy link
Member Author

@agramfort : Thanks for the reviews 👍

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 866d9e3 on Manoj-Kumar-S:MultiENetCV into aa8139b on scikit-learn:master.

@MechCoder
Copy link
Member Author

@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?

@MechCoder
Copy link
Member Author

@agramfort : Do I need to add docs to the .rst file as well?

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 9a60b31 on Manoj-Kumar-S:MultiENetCV into aa8139b on scikit-learn:master.

@agramfort
Copy link
Member

Ok fair enough

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 45d8431 on Manoj-Kumar-S:MultiENetCV into adea283 on scikit-learn:master.

@MechCoder
Copy link
Member Author

Tests pass :)

@vene
Copy link
Member

vene commented Jan 18, 2014

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?

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 1ed9cbf on Manoj-Kumar-S:MultiENetCV into adea283 on scikit-learn:master.

@MechCoder
Copy link
Member Author

@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.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 35a5a7a on Manoj-Kumar-S:MultiENetCV into 877d892 on scikit-learn:master.

Copy link
Member

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?

Copy link
Member

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_

@MechCoder
Copy link
Member Author

@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

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling b757d30 on Manoj-Kumar-S:MultiENetCV into 877d892 on scikit-learn:master.

@agramfort
Copy link
Member

+1 for merge on my side. Thanks @manoj-kumar-s

an external review maybe @GaelVaroquaux @fabianp @mblondel @ogrisel @jnothman ?

@MechCoder
Copy link
Member Author

@agramfort . Doesn't the earlier +1 by @jnothman still hold (#2598 (comment)) ;)

@MechCoder
Copy link
Member Author

@agramfort Can this be merged? @jnothman I understand that you are busy, but all that i need is a +1. :)

@jnothman
Copy link
Member

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.

@MechCoder
Copy link
Member Author

I'm sorry. I just got a bit hyped because this was my first big PR. I promise to be really patient.

@jnothman
Copy link
Member

Thanks and congratulations, Manoj! It's merged as a917a02.

@jnothman jnothman closed this Jan 20, 2014
@MechCoder MechCoder deleted the MultiENetCV branch January 21, 2014 04:19
@MechCoder
Copy link
Member Author

Thanks a lot guys :)

@agramfort : Really quick question. Hope you wouldn't mind.
How do I contact you via email (regarding GSoC) ? You seem to have a list of email id's. I don't know which one to write to.

[email protected]
[email protected]
[email protected]

@GaelVaroquaux
Copy link
Member

On Tue, Jan 21, 2014 at 12:09:07AM -0800, Manoj Kumar wrote:

Thanks a lot guys :)

@agramfort : Really quick question. Hope you wouldn't mind.
How do I contact you via email (regarding GSoC) ? You seem to have a list of
email id's. I don't know which one to write to.

Don't contact anybody privately, use the mailing list, but a very
explicite title.

@MechCoder
Copy link
Member Author

@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?

@agramfort
Copy link
Member

@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

@MechCoder
Copy link
Member Author

@agramfort Is it this one? #2526
I'll definitely have a look tonight or tomorrow... Running into some college work...

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?

@agramfort
Copy link
Member

@agramfort https://github.com/agramfort Is it this one? #2526#2526

yes

I'll definitely have a look tonight or tomorrow... Running into some

college work...

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?

yes. Continue to send PRs. The more you know the code base the more you
will find weak spots for a good GSOC proposal.

@GaelVaroquaux
Copy link
Member

@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.

I haven't missed it. I have a huge stack of things to do, and this hasn't
gone up high enough the priority list.

I am sorry, but we all get a lot of requests on many fronts, and
scikit-learn is for most of us a tiny fraction of our activity.

@MechCoder
Copy link
Member Author

@GaelVaroquaux : Ok, I will continue trying to fix bugs, till you are free enough. Is that ok?

@MechCoder MechCoder mentioned this pull request Jul 3, 2014
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants