Search code examples
confusion-matrix

Difference between precision and recall


Suppose a model that predicts if a person likes machine learning or not has a 99 percent true positive rate and a 1 percent false-negative rate, and the probability of a person liking machine learning is 0.5%. What is the probability that a person predicted by the model as positive actually likes machine learning?


Solution

  • This can be solved by conditional probability, Let's assume that two events are occuring where event 1 is your model is predicting y=1 (person likes machine learning) and the event 2 is probability of liking a machine learning is 0.5%. So, P(Ypred=1) = 99% and P(Ytrue=1) = 0.5%. Now,we have to predict ypred=1 given 0.5% of chances of happening that and by conditional probability theorem we can write it as Ytrue= P(Ypred=1|Ytrue=1) = P(Ytrue=1|Y_pred=1) (think of this term as True Positive) * P(Ypred=1) (and this term value we already know). So, P(Ypred=1|Ytrue=1) = 0.5 * 0.99 = 0.495. I guess this answer your question.