KatInterview

Matching Test Errors to Classifier Metrics: FP, FN, Precision, Recall

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentshypothesis-testingtype-i-errortype-ii-error

Last updated

Link false-alarm and missed-detection errors in hypothesis tests to classifier metrics, explain why precision depends on prevalence, and judge which error hurts more in practice.

Statisticians and ML engineers describe the same mistakes in different vocabularies. Show that you can move between the two.

Consider a yes/no decision, either a hypothesis test or a binary classifier, where the null hypothesis stands for "nothing is going on" and a "positive" result means the null is rejected.

  1. Define a Type I error and a Type II error. Also define significance level, power, and how each relates to the confusion matrix.
  2. Explain how these errors connect to false positives, false negatives, precision, and recall. State which of the quantities are conditioned on the true state of the world and which on the model's prediction.
  3. Describe situations where a Type I error is the more expensive mistake, and situations where a Type II error is. Give concrete examples for each.
  4. For each of these settings, say what a Type I and a Type II error would look like: fraud detection, spam filtering, medical screening, and an A/B test.

Be explicit about which outcome you label "positive" in each setting.

Hints

Hint 1

Start by fixing a convention: the null is the 'nothing there' state, and positive means rejecting it. Then fill in a 2x2 table of truth versus decision.

Hint 2

Ask which denominator each metric uses. Recall and the Type II rate are both computed over actual positives. Precision is computed over predicted positives, so it cannot equal 1 minus the Type I rate.

Hint 3

Use Bayes' rule with a rare base rate (for example 1% prevalence) to show that a small false positive rate can still produce mostly false alerts.

Hint 4

For cost questions, think about reversibility and what a follow-up check costs. Cheap second-stage verification often justifies a high-recall first stage.