scikit-learn / scikit-learn

scikit-learn: machine learning in Python
https://scikit-learn.org
BSD 3-Clause "New" or "Revised" License
60.27k stars 25.43k forks source link

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

Open davidsteinar opened 3 years ago

davidsteinar commented 3 years ago

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 commented 2 years ago

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

cmarmo commented 2 years ago

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?