An equivelant of predict_proba in fastai2?

Hello everyone,
I am wondering if there is a way to get a list of probabilities of all classes for a model in fastai2 like in scikit_learn model?

Thank you

Hi @RMNT,

fastai’s learner.predict will return 3 outputs by default:

  • the name of the predicted class
  • the index of the predicted class
  • the predicted probabilities for each class

So, the third output should be what you’re looking for. You can find out more in the docs: https://docs.fast.ai/learner#Learner.predict

Thank you, not sure how I missed it