aangelopoulos / conformal-prediction

Lightweight, useful implementation of conformal prediction on real data.
http://people.eecs.berkeley.edu/~angelopoulos/blog/posts/gentle-intro/
MIT License
745 stars 85 forks source link

how to use conformalized bayes for classification tasks #16

Open pasq-cat opened 3 weeks ago

pasq-cat commented 3 weeks ago

Hi, i am trying to implement the support to conformalized bayes to conformalprediction.jl. By following your article A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification, I succeeded in creating a conformalized bayes regressor ( https://github.com/JuliaTrustworthyAI/ConformalPrediction.jl/pull/125) but i am struggling to understand how to do the same for a classifier. For each new point x_pred, LaplaceRedux.jl gives the estimated MAP and the variance fvar. In the case of Bayes regressor i have computed the score as the negative of the probability of observing y_true, given the predicted mean and variance and assuming a gaussian distribution, but now i am not sure how to compute the score when i have discrete classes.