I want to calculate the prediction interval of individual predictions without knowing what it's target value is gonna be. For example, I am doing a blood glucose prediction of individual patients and I want to predict what his/her blood glucose value is going to be after 1 hour. I want to compute where that value is gonna lie. (Predicted value: 250, lies within : 220 - 270 or something) And I don't know what his/her actual value is going to be in next hour. So is it possible to achieve this?


1 Answer 1


What you are referring to is a problem of estimation regression model uncertainty. The uncertainty estimation method depends on the model that you are using. Take a look at this tutorial, it provides a detailed explanation of what to do when you are using Linear Regression. It also points to the more sophisticated paper, which describes what to do when your model is more complicated.

If you are working with Regression Trees (xgboost) this tutorial provides a code that you can use.

  • $\begingroup$ Hey, In my work I am using k-means clustering to cluster patients depending on their characteristics. Then for each cluster a model is trained using gradient boosting algorithm. So for that type of work how can I use this? $\endgroup$
    – HelloWorld
    Mar 26, 2020 at 8:07
  • $\begingroup$ Hello. I assume that you are using GBR from the sklearn. See this example. $\endgroup$ Mar 26, 2020 at 10:12
  • $\begingroup$ Yeah exactly. Thanks for your wonderful answer I will definitely go through it. $\endgroup$
    – HelloWorld
    Mar 26, 2020 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.