confusion matrix - how to determine values of TN and FN

839 Views Asked by At

Given is a problem statement -

Let there be 10 balls of which 6 are white and 4 are red. Let it be required to pick up the red balls from them. Suppose, we pick up 7 balls as the red balls of which only 2 are actually red balls. What are the values of precision and recall in picking red balls?

For the given problem, in the solution I found at the confusion matrix values are given accordingly: TP = 2, FP = 5, FN = 2, TN = 1

I understand how TP and FP are the values mentioned above, but can someone explain how FN and TN is 2 and 1 respectively?

2

There are 2 best solutions below

0
On

Total $10$ balls

Predicted $7$ balls are red ($TP+FP$), $2$ are actually red ($TP$), $5$ are not red ($FP$)

This implies that $3$ were predicted to be not red ($TN+FN$), $1$ is actually not red ($TN$), $2$ are red ($FN$).

$recall=\frac{TP}{TP+FP}=\frac{2}{7}$

$precision=\frac{TP}{TP+FN}=\frac{2}{2+2}=0.5$

0
On

The question states that $7$ balls are chosen as red balls, implying that it predicted $3$ as not red. Furthermore, the question states that there are actually $2$ red balls among the predicted red balls. This means that one of the balls is white and the other $2$ are red among the three predicted as not red. This means that just one of the three balls predicted to be not red is truly not red, so $TN=1$, and likewise, the other $2$ red balls are falsely predicted to be red, so $FN=2$.

Thus $TP = 2, FP = 5, TN = 2,$ and $FN = 2$.


Precision $= \dfrac{TP}{TP + FP}= \dfrac{2}{ 7}= 0.28$

Recall $= \dfrac{TP}{TP+FN} =\dfrac 24 = 0.5$