# Compute accuracy of model evaluation

Say the number of negativ classes is $9990$ and the number of positive classes is $10$.
If a model predicts all examples to belong to the negative class, how accurate is this prediction?

So what we got:

• Actual positive (TP): 10
• Actual negative (TN): 9990
• Predicted positive (FP): 0
• Predicted negativ (FN): 10000

So the accuracy would be: $\frac{TP+TN}{TP+TN+FP+FN} = \frac{10+10000}{10+10000+0+10000)} = 0.5$

But it doesn't seem to be correct.

• TP is "True Positive" (predicted positive and actually positive: $0$ here). TN is "True Negative" (predicted negative and actually negative: $9990$ here). FP is "False Positive" (predicted positive and actually negative: $0$ here). FN is "False Negative" (predicted negative and actually positive: $10$ here). Commented Feb 5, 2016 at 18:47
• Despite the question starting with important definitional errors, this Q/A is a concise and useful reference for new stats learners. Thank you. Commented Feb 9, 2022 at 18:58

Yeah, that's wrong.

FN = false negative = 10

FP = false positive = 0

TP = true positive = 0

TN = true negative = 9990

accuracy = $\frac{9990 + 0}{10 + 9990 + 0 + 0}$ = 99.9%

• Isn't it $\frac{TP+TN}{TP+TN+FP+FN}$? Commented Feb 5, 2016 at 17:40
• yeah, sorry, I've changed it. Commented Feb 5, 2016 at 17:44
• I think TP should be 0, as nothing has been classified positive. $\frac{0+9990}{0+9990+0+10} = 99.9\%$ Commented Feb 5, 2016 at 17:53
• Wow, i'm failing here. I'm pretty sure it is now correct. Commented Feb 5, 2016 at 17:54