[MRG+1] Fix precomputation of Gram matrix in Lars#5359
[MRG+1] Fix precomputation of Gram matrix in Lars#5359agramfort merged 1 commit intoscikit-learn:masterfrom
Conversation
There was a problem hiding this comment.
I would say raise an error instead of a warning but it depends on how much we want to nurse the user.
There was a problem hiding this comment.
I was thinking about avoiding an error when a user changes Lars(precompute=G).fit(X, y) into LarsCV(precompute=G).fit(X, y). But it is kind of nursing.
0d8ed92 to
e059923
Compare
9d58692 to
ed10cf1
Compare
|
LGTM @TomDLT can you update what's new to document the bug fix? |
|
done |
|
+1 for MRG when CIs are happy thx @TomDLT |
arthurmensch
left a comment
There was a problem hiding this comment.
To me it would make more sense to explicitely feed the gram matrix in the .fit but I reckon this has little usage anyway. LGTM
| return Gram | ||
| def _get_gram(self, precompute, X, y): | ||
| if (not hasattr(precompute, '__array__')) and ( | ||
| (precompute is True) or |
|
CIs are happy here |
|
@TomDLT you need to rebase |
|
|
@TomDLT please fix conflicts here and then let's merge. |
f7ff310 to
71f14cd
Compare
|
The AppVeyor failures are on master #9111 |
|
thanks @TomDLT |
This is a fix for the bug reported in #1856.
The parameter
precompute(in RandomizedLasso, Lars, LarsLasso, LarsCV and LarsLassoCV) were not consistent and some values proposed in the docstrings (False, array) could raise errors.This PR includes the following steps:
lars_path, to allowGram=TrueandGram=False._get_grammethod, to handleprecomputein the same way in every class.precompute, in LarsCV and LarsLassoCV.test_randomized_l1.pyis also updated to be shorter (from 1.582s to 0.817s).test_least_angle.pygoes from 1.305s to 1.465s.