Skip to content

Show the std of parameters posterior distribution for Bayesian ridge regression #20964

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

Open
davidsteinar opened this issue Sep 7, 2021 · 2 comments

Comments

@davidsteinar
Copy link

davidsteinar commented Sep 7, 2021

Describe the issue linked to the documentation

In the documentation for Bayesian ridge regression the standard deviation for the posterior distribution of the target variable is easily accessed by calling .predict(X, return_std=True).

However, there is no comparable method for accessing standard deviations for the posterior distributions of the learned parameters. The means of the parameters posterior distributions are given by .coef_ , but the corresponding standard deviation is not easily available.

Am I correct that the standard deviation would be given by the square root of the diagonal of the covariance matrix?
np.sqrt(clf.sigma_.diagonal())

Suggest a potential alternative/fix

Provide an example of accessing the standard deviation of the posterior distribution of the learned parameters.

@marinadelaunay
Copy link

marinadelaunay commented Dec 2, 2021

Hi @davidsteinar @cmarmo
I would like to work on this issue. It would be my first contribution.

@cmarmo
Copy link
Contributor

cmarmo commented Dec 23, 2021

Hello @marinadelaunay thanks for your interest in contributing to scikit-learn.
This issue haven't received any comment so far. It is likely to take some time before your pull request will have attention.
Perhaps #21350 is more suitable to a first contribution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants