deel-ai / puncc

👋 Puncc is a python library for predictive uncertainty quantification using conformal prediction.
https://deel-ai.github.io/puncc/
252 stars 14 forks source link

[Feature]: prevent empty sets (keep conformal validity, lose upper bound tight coverage) #41

Closed lmossina closed 6 months ago

lmossina commented 7 months ago

While working with conformal classification with JD, we realized that it makes sense to be able to force non-empty prediction sets, at least from an operational point of view.

For example, in classification via softmax, this corresponds to always including the class whose score is highest (even if very low). In the case of (R)APS, this means bypassing the randomization step.

In the RAPS paper, here is the explication of the phenomenon:

Here also the detail of the algo with and without the randomization:

I reckon we could achieve this simply by adding a flag to the class, such as at instantiation: