-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] FIX: Allow coef_=None with warm_start=True in MultiTaskElasticNet #12844
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
LGTM |
Just for my own understanding, when does it makes sense to want warm-starting while having no coefficients to start with? |
@NicolasHug IIUC it's just a convenience thing at our end that we can always have |
... by "our function" I mean in a function we have in another library (MNE), and callers of that function don't need to care about |
Ok thanks. So I guess my question becomes: how can If your use-case is 'we allow our users to set |
In the latest In
No our use case is to repeat instantiation + fit steps, supplying a properly shaped |
That seems to be legacy code from times when setting attributes
8000
in but this is not the case anymore. Would need input from core devs. @amueller maybe? EDIT:
So you're still doing something like |
I don't see why we should support this. This is not in line with any standard contracts in sklearn. If you want to do this, I feel it's up to you (MNE) to ensure something sensible happens. |
This restores the ability to have
clf.coef_ = None
during fitting withclf = MultiTaskElasticNet(..., warm_start=True)
. Code that currently works with the latest release started emitting this error when running onsklearn
master (now shown with the error in the test suite when the changes tocoordinate_descent.py
are omitted):One potential alternative is that I could in my code set
warm_start=False
if the user suppliescoef_ = None
, rather than always passingwarm_start=True
. Feel free to close if that's the preferred way, though it's possible other people might also get hit by this problem if they also relied onwarm_start=True
followed byclf.coef_ = None
working.Just modified an existing test to avoid adding to test time, but can split it off if it seems worthwhile.