opened
joaak
username_0
<!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#pull-request-checklist
-->

#### Reference Issues/PRs

Fixes #12360 

#### What does this implement/fix? Explain your changes.

In the original source code, within the class MultiTaskElaticNet, `if not self.warm_start or self.coef_ is None:` (line 1798) throws an error that the object has no attribute 'coef_' when a MultiTaskElaticNet/MultiTaskLasso object is created with `warm_start = True`.

Potential Fix:

Replace 

`if not self.warm_start or self.coef_ is None:` 

with 

`if not self.warm_start or not hasattr(self, "coef_"):` 

(The replacement is what has been done in line 733 within the ElasticNet class in the original source code).

<!--
Please be aware that we are a loose team of volunteers so patience is
necessary; assistance handling other issues is very welcome. We value
all user contributions, no matter how minor they are. If we are slow to
review, either the pull request needs some benchmarking, tinkering,
convincing, etc. or more likely the reviewers are simply busy. In either
case, we ask for your understanding during the review process.
For more information, see our FAQ on this topic:
http://scikit-learn.org/dev/faq.html#why-is-my-pull-request-not-getting-any-attention.

Thanks for contributing!
-->
Fix Error: 'MultiTaskLasso' object has no attribute 'coef_' when warm_start = True
issue
created
jnothman
username_1
Please add a non-regression test
comment
created
joaak
username_0
AppVeyor build seems to be failing for `Environment: PYTHON=C:\Python27, PYTHON_VERSION=2.7.8, PYTHON_ARCH=32` and for a test called `test_count_nonzero`.

I'm not sure if this was triggered by the test I added. Please let me know if there's anything required on my side to rectify this.
comment
created
agramfort
username_2
got to go from my end
comment
created
jnothman
username_1
Yes, that should work. Writing a test is a better way to be sure, though
comment
created
agramfort
username_2
what's new is updated and test is there.

@username_1 ok to merge?
comment
created
jnothman
username_1
Thanks @username_0
comment