Probabilistic ML with Quantile Matching: an Instance with Python | by Davide Burba | Sep, 2023

A little bit-known approach for turning quantile regression predictions right into a likelihood distribution.
Once we practice regressive fashions, we receive level predictions. Nonetheless, in apply we are sometimes thinking about estimating the uncertainty related to every prediction. To attain that, we assume that the worth we try to foretell is a random variable, and the aim is to estimate its distribution.
There are a lot of strategies obtainable to estimate uncertainty from predictions, equivalent to variance estimation, Bayesian methods, conformal predictions, and so on. Quantile regression is considered one of these well-known strategies.
Quantile regression consists in estimating one mannequin for every quantile you have an interest in. This may be achieved by means of an uneven loss operate, referred to as pinball loss. Quantile regression is straightforward, simple to know, and available in excessive performing libraries equivalent to LightGBM. Nonetheless, quantile regression presents some points:
- There isn’t any assure that the order of the quantiles will likely be right. For instance, your prediction for the 50% quantile may very well be better than the one you get for the 60% quantile, which is absurd.
- To acquire an estimate of the complete distribution, it’s essential practice many fashions. For example, for those who want an estimate for every level % quantile, you need to practice 99 fashions.
Right here’s how quantile matching will help.
The aim of quantile matching is to suit a distribution operate given a pattern of quantile estimates. We will body this as a regression drawback, so the curve doesn’t must completely match the quantiles. As an alternative, it must be “as shut as potential”, whereas preserving the properties which make it a distribution operate.
Particularly, we’re thinking about estimating the inverse cumulative distribution operate: given a…