Traffic Jams have become a common part of our lives now-a-days. Living in an urban area means you have to face traffic each and every time you get out on the road. Mostly, school students opt for buses to go to school. Many times the bus gets late due to such jams and students are not able to reach their school on time. Thus, an AI model is created to predict explicitly if there would be a traffic jam on their way to school or not. The confusion matrix for the same is
Explain the process of calculating F1 score for the given problem.
Generated by claude-sonnet-4-6 · 2026-06-21 03:18 · grounding stimulus
Model Answer
From the confusion matrix:
- TP = 50, FP = 50, FN = 0, TN = 0
Step 1 – Calculate Precision:
$$\text{Precision} = \frac{TP}{TP + FP} = \frac{50}{50 + 50} = \frac{50}{100} = 0.5$$
Step 2 – Calculate Recall:
$$\text{Recall} = \frac{TP}{TP + FN} = \frac{50}{50 + 0} = \frac{50}{50} = 1$$
Step 3 – Calculate F1 Score:
$$\text{F1 Score} = \frac{2 \times \text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}} = \frac{2 \times 0.5 \times 1}{0.5 + 1} = \frac{1}{1.5} = 0.67$$
The F1 Score for this model is 0.67.
Source: AI Chapter – Evaluating AI Models (Confusion Matrix & Performance Metrics)
---
Explanation
- Examiners expect all three steps to be shown: Precision → Recall → F1.
- Identify TP, FP, FN, TN correctly from the confusion matrix first — that is the foundation.
- Write the formula for each metric and substitute values clearly; step-by-step working earns full marks.
- F1 Score is the harmonic mean of Precision and Recall, used when there is a class imbalance — relevant here since TN = 0.