Page 304 - Ai Book - 10
P. 304
60.70 × .31
= 2 ×
64.70 + .31
20.057 40.114
= 2 × = = 0.61
65.01 65.01
Scenario 2: A lot of times people face the problem of sudden downpour. People wash clothes and put them out
to dry but due to unexpected rain, their work gets wasted. Thus, an AI model has been created which predicts if
there will be rain or not. The confusion matrix for the same is:
The Confusion Matrix Reality: 1 Reality: 0
Predicted: 1 5 0
Predicted: 0 45 50
Calculate Accuracy, Precision, Recall and F1 Score for the above problem.
TP FP
5 0
45 50
(TP + TN)
Accuracy = × 100
(TP + TN + FP + FN)
5 + 50
= × 100
5 + 50 + 45 + 0
55
= × 100 = 50
100
TP
Recall =
TP + FN
5
= = 0.1
5 + 45
TP
Precision = × 100
TP + FP
5
= = 1
5 + 0
Precision × Recall
F1 Score = 2 ×
Precision + Recall
1 × 0.1
= 2 × = 2 × 0.090 = 0.18
1 + 0.1
178
178