Professional Documents
Culture Documents
Solution: Let’s say that the cat images are a Positive class, whereas the dog pictures are
a Negative one, i.e., is a cat and is not a cat of the 15 cat images (P), 9 were predicted as the
dog ones. So, only 15 - 9 = 6 predictions were correct. TP = 6. Of the 20 dog images
(N), 6 were predicted as the cat ones. So, 20 - 6 = 14 predictions were correct. TN = 14.
9 pictures were predicted as the dog ones, but they actually have a cat on them. So, FN = 9;
6 images were predicted as the cat ones, but they actually have a dog on them. So, FP = 6.
Confusion Matrix:
1) Accuracy:
OR
So, by the above formula, we have:
6+ 14
Accuracy=
6+6+ 9+14
20
Accuracy=
35
Acuracy=0.571428571
2) Precision:
6
precision=
6+6
6
precision=
12
precision=0.5
6
Recall=
15
Recall=0.4
14
Specificity=
20
Specificity=0.7
5) False Positive Rate:
6
FPR=
6+14
6
FPR=
20
FPR=0.3
OR
FPR=1−SPECIFICITY
FPR=1−0.7
FPR=0.3
6) Error Rate:
6+9
ERR=
35
15
ERR=
35
ERR=0.428571429