FIX Covariance matrix in BayesianRidge#31094
Merged
jeremiedbb merged 10 commits intoscikit-learn:mainfrom Apr 13, 2025
Merged
Conversation
Contributor
Author
|
The failing tests on the Linux debian_32bit seem unrelated to this PR, so I think it is ready for review. FAILED tests/test_common.py::test_estimators[LinearRegression(positive=True)-check_sample_weight_equivalence_on_dense_data] - AssertionError:
FAILED utils/tests/test_estimator_checks.py::test_check_estimator_clones - AssertionError: |
Member
|
I opened #31098 for the CI failure. |
ogrisel
approved these changes
Mar 28, 2025
doc/whats_new/upcoming_changes/sklearn.linear_model/31094.fix.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
test_bayesian_covariance_matrix
lucyleeow
pushed a commit
to EmilyXinyi/scikit-learn
that referenced
this pull request
Apr 23, 2025
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org> Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
xuefeng-xu
added a commit
to xuefeng-xu/fedps
that referenced
this pull request
Jul 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31093
What does this implement/fix? Explain your changes.
Using the reduced SVD leads to an incorrect covariance matrix when
n_samples < n_features.This PR uses the full SVD to compute the posterior covariance matrix when
n_samples < n_features, and keeps the reduced SVD whenn_samples > n_featuresfor performance in the largen_samplescase.The non-regression test
test_bayesian_covariance_matrixis added.