LambdaLabTM
Artificial Intelligence · Class 10 · Unit 3 · Evaluating Models
class 10 aievaluation⏱️ 9 min read

F1 Score, and Choosing a Metric

Sometimes you genuinely cannot say whether a false positive or a false negative is worse. The F1 score exists for exactly that situation.

1What the F1 score is

F1 Score
A way to combine both precision and recall into a single measure that captures both properties.
F1 Score = 2 × Precision × Recall / (Precision + Recall)

Use it when the dataset is unbalanced and you are unable to decide whether FP or FN is more important. A high F1 score means a good balance between precision and recall.

It is not an average
The obvious thing to do with two numbers is to add them and halve them. F1 does not do that. Because the two are multiplied on top, a score that is very low on either one drags F1 right down — you cannot make up for terrible recall with brilliant precision.

Two wheels

A bicycle with one perfect wheel and one flat one is not “averagely rideable”. It does not go. F1 behaves the same way: both parts have to be decent before the number looks good.

2Working one out

Do it in three steps and write each one down — the marks are for the working, not just the final figure.

  1. Precision = TP / (TP + FP)
  2. Recall = TP / (TP + FN)
  3. F1 = 2 × Precision × Recall / (Precision + Recall)
The confusion matrix, and what comes out of it

Pick a metric to light up the cells it is built from. Precision is the top row; recall is the left column.

Actual / Reality
YesNo
Predicted Yes
TP
50
FP
40
Predicted No
FN
12
TN
10
Accuracy = (50 + 10) / 112 = 53.57%
Precision = 50 / (50 + 40) = 0.5556
Recall = 50 / (50 + 12) = 0.8065
F1 = 2 × 0.5556 × 0.8065 / (0.5556 + 0.8065) = 0.6579

Mobile phone sales prediction. Positive class: Phone sells. The board handed over the finished matrix and asked for the wrong predictions, then precision, recall and F1.Source: CBSE sample paper 2024-25

3Choosing between all four

The decision, in one table
UseWhenBecause
AccuracyThe classes are balanced and both mistakes matter equallyIt counts every correct prediction, TP and TN alike
PrecisionA false positive is the costly mistakeIt punishes FPs and ignores FNs
RecallA false negative is the costly mistakeIt punishes FNs and ignores FPs
F1 ScoreUnbalanced data and you cannot say which mistake is worseIt balances precision against recall in one number
How to answer 'which metric' in the exam
Name the metric, then say which mistake you are trying to avoid, then say why that mistake is the expensive one in this scenario. All three sentences are needed; a bare metric name rarely gets full marks.

4From the board papers

1
F1 Score is the measure of the balance between:
(a) Accuracy and Precision (b) Precision and Recall (c) Recall and Accuracy (d) Recall and RealityCBSE sample papers 2023–24 and 2024–25
1 mark
▶Show the answer

(b) Precision and Recall. Those are the only two quantities in the formula.

2
An AI model made the following sales prediction for a newly launched mobile phone. The confusion matrix has Prediction down the side and Reality across the top: Prediction Yes — Reality Yes 50, Reality No 40. Prediction No — Reality Yes 12, Reality No 10.
(i) Identify the total number of wrong predictions. (ii) Calculate precision, recall and F1 score.CBSE sample papers 2023–24 and 2024–25
4 marks
▶Show the answer

Read the matrix first: TP = 50, FP = 40, FN = 12, TN = 10.

(i) Wrong predictions = FP + FN = 40 + 12 = 52.

(ii)
Precision = 50 / (50 + 40) = 50/90 = 0.5556
Recall = 50 / (50 + 12) = 50/62 = 0.8065
F1 = 2 × 0.5556 × 0.8065 / (0.5556 + 0.8065) = 0.8962 / 1.3621 = 0.6579

Note the shape of this result: recall is high and precision is poor, so the model finds most of the real sales but shouts “yes” far too often. F1 lands between the two, nearer the weaker one.

3
A spam detection system: TP = 150, FP = 50, TN = 750, FN = 50, out of 1000 emails. Calculate accuracy, precision, recall and F1 score.Class X handbook, Case Study 1
4 marks
▶Show the answer

Accuracy = (150 + 750) / 1000 = 0.90 = 90%
Precision = 150 / (150 + 50) = 150/200 = 0.75
Recall = 150 / (150 + 50) = 150/200 = 0.75
F1 = 2 × 0.75 × 0.75 / (0.75 + 0.75) = 1.125 / 1.5 = 0.75
When precision and recall are equal, F1 equals them both — a useful check that you have not slipped up in the arithmetic.

4
Identify which metric (precision or recall) should be used, and why: (a) email spam detection (b) cancer diagnosis (c) legal cases, where a defendant is innocent until proven guilty (d) fraud detection (e) safe content filtering for a children’s app.Class X handbook, Case study questions
2 marks
▶Show the answer

(a) Precision. A real email wrongly binned as spam may never be read; a spam message getting through is a nuisance.
(b) Recall. Missing a real case of cancer is far worse than a false alarm, which further tests will clear up.
(c) Precision. Convicting an innocent person is the mistake the whole principle exists to prevent.
(d) Recall. A legitimate transaction flagged can be re-verified; a fraudulent one waved through cannot be undone.
(e) Recall. Blocking a harmless video is a small loss; letting an unsafe one reach a child is the failure that matters.

5Check yourself

Quick Check

A high F1 score generally suggests:

Quick Check

When should the F1 score be used?

Quick Check

A model has precision 0.75 and recall 0.75. Its F1 score is:

Quick Check

Which metric would you use where a false positive is the expensive mistake?