AWS AI Practitioner AIF-C01 · Fundamentals of AI and ML · medium

A medical screening model evaluates 1,000 patients for a rare condition and produces the following confusion matrix: True Positives (TP = 80), False Positives (FP = 20), False Negatives (FN = 20), and True Negatives (TN = 880). What are the model's Precision (TP / (TP + FP)) and Recall (TP / (TP + FN))?

Published · Last updated · checked before publication — how we verify questions

Options

  • APrecision = 96% and Recall = 96% (including True Negatives)
  • BPrecision = 80% and Recall = 8.3% (dividing TP by TP + TN)
  • CPrecision = 80% and Recall = 80% (80 / 100 for both metrics)Correct answer
  • DPrecision = 50% and Recall = 50% (dividing FP by FP + FN)

Answer: C. Precision = 80% and Recall = 80% (80 / 100 for both metrics)

Precision asks: of everything the model flagged as positive, how many were truly positive? That is TP divided by TP plus FP, which is 80 divided by 100, or 80 percent. Recall asks: of all the patients who truly have the condition, how many did the model find? That is TP divided by TP plus FN, which is also 80 divided by 100, or 80 percent. Both metrics put True Positives in the numerator and ignore True Negatives entirely, which is why they are preferred over accuracy for rare-condition screening where negatives dominate. The common trap is mixing up the denominators or pulling True Negatives into the calculation, which inflates the result. Remember that precision's denominator is all predicted positives (columns of the positive prediction), while recall's denominator is all actual positives. Here both happen to equal 100, so the two metrics coincide and F1 is also 80 percent.

Why the other options are wrong

  • A. Precision = 96% and Recall = 96% (including True Negatives) — 96 percent is overall accuracy, (TP + TN) / total = 960 / 1000. Accuracy counts True Negatives, but precision and recall do not, so this answer reports a different metric and is misleading for a rare condition.
  • B. Precision = 80% and Recall = 8.3% (dividing TP by TP + TN) — Dividing TP by TP + TN is not a standard metric. Recall's denominator is TP + FN, the actual positives, giving 80 percent rather than 8.3 percent, and precision's denominator is TP + FP, so TN does not belong in either formula.
  • D. Precision = 50% and Recall = 50% (dividing FP by FP + FN) — A ratio built from FP and FN describes error counts, not the metrics asked about. Precision and recall both have True Positives in the numerator, so the result is 80 percent for each, not 50 percent.

All Fundamentals of AI and ML questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.