recommenders icon indicating copy to clipboard operation
recommenders copied to clipboard

How to get confidence for prediction?

Open max-grzanna opened this issue 4 years ago • 3 comments

Hello people,

is there a way to get a confidence score for the generated predictions? I am looking for a score like a probability or something to see how confident the model is regarding the first 3 predictions.

Thanks and regards!

max-grzanna avatar Dec 01 '21 11:12 max-grzanna

I believe the faktorizedTop3 on the testing dataset will give you the percentage of the times where the actual selection was in the top 3 recommendations, which may suit you.

https://www.tensorflow.org/recommenders/api_docs/python/tfrs/metrics/FactorizedTopK

YannisPap avatar Dec 07 '21 12:12 YannisPap

AFAIK prediction uncertainty like this is actually an open research problem, especially given that the scores returned by two-tower models are usually unnormalized and not probabilities.

maciejkula avatar Dec 20 '21 18:12 maciejkula

What about using tf.sigmoid(logits) to convert the unnormalized logits to "probabilities" ranging from 0 to 1?

rlcauvin avatar Jun 15 '23 21:06 rlcauvin