Confidence interval

Hi,
How can we compute confidence interval with scitkit-learn ?

Thanks

Could you be more explicit about which confidence intervals are you referring to?

I try to compute a confidence interval for every parameter for a model. For example, for logistic regression, I need to compute a confidence interval for each parameter B1, B2 … logit (P) = a + B1X1 + B2X2 + …
Logistic regression is widely used in epidemiology because of its relation with the odds-ratio (relative risk), and we always interpret it with a confidence interval.
Thank for this great mooc.

There is no build-in solution in scikit-learn. It is more in the scope of statsmodel. You can refer to the following issue on the topic: Confidence intervals for linear models · Issue #6773 · scikit-learn/scikit-learn · GitHub

As posted in the issue, you can still compute the intervals by hand. The example of the user was posted in a gist for the case of LogisticRegression: Confidence Intervals for Logistic Regression · GitHub

On the topic of confidence intervals, scikit-learn will provide soon (in the upcoming 1.0 version) an estimator called QuantileRegression: [MRG] Add quantile regression by avidale · Pull Request #9978 · scikit-learn/scikit-learn · GitHub

We also have GaussianProcessRegressor (Gaussian Processes regression: basic introductory example — scikit-learn 0.24.2 documentation) that is a build-in probabilistic regression technique where confidence on the predictions is provided.

1 Like