First, the key terms.

True positive
A positive prediction for a genuinely positive case.
False positive
A positive prediction for a negative case.
False negative
A missed positive case.

The idea, explained

Precision is TP / (TP + FP); recall is TP / (TP + FN). TP means true positives, FP false positives and FN false negatives. Changing a classifier’s decision threshold can trade one kind of error for another. Choose metrics that reflect the task, and inspect the data and error cases behind a single score.

STEP 1

Start with actual counts

Before calculating metrics, define which outcome counts as positive. In a defect detector, “positive” might mean a defective item. A high positive rate is not necessarily good news; it depends on the task.

STEP 2

Ask two different questions

Precision asks how many flagged cases really are positive. Recall asks how many actual positives were found. Changing a decision threshold often changes both. Report counts and the population alongside percentages so readers understand the scale.

Follow a worked example.

A filter flags 20 messages. Of those, 15 are actually spam, and there were 30 spam messages in total. Precision is 15/20 = 75%; recall is 15/30 = 50%. A high precision score here does not mean the filter caught most spam.

Walk it through, one step at a time

  1. A system flags 20 products. Of these, 15 are defective and 5 are not. Precision is 15 ÷ 20 = 75 percent.
  2. There are 30 defective products in total. Recall is 15 ÷ 30 = 50 percent, because half were found.
  3. The system’s flags are often useful, yet it misses many defects. Neither metric alone describes all operational consequences.

Where people get stuck

Accuracy can conceal a weak classifier when one class dominates the test set.

Now try it yourself.

Pause before opening each answer. Explain your reasoning in your own words.

1. Check the core idea

Which metric highlights spam that the filter missed?

Reveal the answer & reasoning

Recall. Missed positives increase false negatives and reduce recall, even if flagged messages are usually correct.

2. Apply what you learned

A reviewer says “precision is 75 percent, so the system finds 75 percent of defects.” What is wrong?

Reveal the answer & reasoning

That confuses precision with recall. Precision describes correctness among flags. Finding the fraction of all defects requires the total number of actual defects.