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

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 chance distribution.

After we practice regressive fashions, we receive level predictions. Nonetheless, in follow we are sometimes considering estimating the uncertainty related to every prediction. To attain that, we assume that the worth we are attempting to foretell is a random variable, and the aim is to estimate its distribution.

There are a lot of strategies accessible to estimate uncertainty from predictions, similar to variance estimation, Bayesian methods, conformal predictions, and so forth. Quantile regression is one among 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 perform, often known as pinball loss. Quantile regression is straightforward, simple to grasp, and available in excessive performing libraries similar to LightGBM. Nonetheless, quantile regression presents some points:

  • There is no such thing as a assure that the order of the quantiles might be right. For instance, your prediction for the 50% quantile might be higher than the one you get for the 60% quantile, which is absurd.

  • To acquire an estimate of your complete distribution, it’s worthwhile to practice many fashions. As an illustration, if you happen to want an estimate for every level % quantile, it’s important to practice 99 fashions.

Right here’s how quantile matching may also help.

The aim of quantile matching is to suit a distribution perform given a pattern of quantile estimates. We will body this as a regression downside, so the curve doesn’t should completely match the quantiles. As a substitute, it ought to be “as shut as doable”, whereas holding the properties which make it a distribution perform.

Particularly, we’re considering estimating the inverse cumulative distribution perform: given a…