[MRG] handle sparse x and intercept in _RidgeGCV #13350
[MRG] handle sparse x and intercept in _RidgeGCV #13350thomasjpfan merged 107 commits intoscikit-learn:masterfrom
Conversation
|
some figures to compare the current and proposed behaviors, which can be https://gist.github.com/jeromedockes/7fca2698f6ab7413903c782becc22c59 |
|
note: the proposed solution passes |
|
I haven't yet merged master because |
thomasjpfan
left a comment
There was a problem hiding this comment.
Another pass over the implementation.
096b444 to
6e5ea75
Compare
|
This formally has 3 approvals. I've not looked at it. Is it ready for merge? Are we releasing in 0.21, or 0.22? |
|
I am still +1 for merge. It seems that all @thomasjpfan comments have been addressed but it would be great to have his confirmation before merging. I think this is an important bug fix so +1 for 0.21 but I am fine to merge to master only for 0.22 if others disagree. |
now _{decomposition method used}_decompose_{decomposed matrix}
and _solve_{provided decomposition}_{matrix whose decomposition is provided}
e.g. _eigen_decompose_covariance, _solve_eigen_covariance
|
We had an IRL discussion with @jeromedockes and we decided to stick to float64 for This means that some of the changes from #13302 have been reverted. Only the |
|
@thomasjpfan please confirm and merge |
|
Looking into it. Going over the implementation one last time before merging. |
|
Thank you! @jeromedockes |
|
Great job @jeromedockes 👏 |
|
many thanks to @agramfort, @glemaitre, @ogrisel and @thomasjpfan for the time |


closes #2354, closes #13325, closes #5364, closes #13321, closes #4781.
Currently, if the design matrix is sparse, no intercept is fitted by
_RidgeGCV, even iffit_interceptis true.This is an attempt to handle this case correctly when
gcv_modeis "eigen",which uses an eigendecompositon of the Gram matrix.
(
gcv_mode="svd"cannot handle sparse matrices because the left singularvectors of X are dense and this could use too much memory).
This is work in progress and for now, to make comparison easier, suggested
changes are implemented in a subclass of
_RidgeGCV,_WIPNewRidgeGCV.