I am running a multivariate linear regression on noisy data, where the amount of error for each measurement is known (or at least estimated). It works reasonably well with weighted linear regression if I weight my rows by uncertainty, e.g. rows with high confidence have high weights and rows with high uncertainty have low weights. However I think I can do better.

Suppose instead of a single prediction for each row, I have an upper and lower bound of an 80% confidence interval. Then I can calculate my cost function as the square of the difference from the interval instead of the square of the difference from the mean.

I can code this pretty easily from scratch, but I wonder if there is an existing library to do this. I am using sklearn now, but don't mind switching from something else. This is ideally for publication, so a standard library, or at least a standard well know equation or formula, would be a big help.


1 Answer 1


You can refer to the mapie library that provides a solution to your requirements. I am providing a link to the official documentation of mapie library, that will give you code examples of implementation along with the theoretical description.



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.