KatInterview

Comparing Two Classifiers with a Proportion Test

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentshypothesis-testingprobabilityz-test

Last updated

Test whether a higher observed positive rate is statistically significant, starting from basic probability rules and building to a two-proportion z-test.

Scenario

You work on a content platform's ranking team. Two versions of a response classifier have been benchmarked: Classifier X labels responses as positive 80% of the time, and Classifier Y labels them as positive 90% of the time. You need to decide whether Y is genuinely better or whether the gap could be noise.

Questions

Part 1 — Basic probability If the probability that any single response is labeled positive is p, and responses are independent, what is the probability that two randomly selected responses are both labeled positive?

Part 2 — Conditional probability under i.i.d. Assume each response from a given user is independently drawn from the same distribution with positive-label probability p. A user's first three responses are all positive. What is the probability that their fourth response is also positive? Explain your reasoning and name the trap to avoid.

Part 3 — Hypothesis test At a 5% significance level, can you conclude that Classifier Y has a higher true positive rate than Classifier X? Walk through:

  • what clarifying questions you would ask before running anything
  • the null and alternative hypotheses
  • the test statistic and how to compute it
  • the decision rule
  • a worked numerical example
  • how your conclusion would change depending on sample size

No sample sizes are given. That is intentional.

Hints

Hint 1

For Part 1, the key property is independence: the probability of two independent events both occurring is the product of their individual probabilities. Generalise to n items.

Hint 2

For Part 2, revisit the definition of conditional probability with i.i.d. random variables. Think about what cancels in the numerator and denominator — and what it would mean to answer differently (there is a named cognitive bias associated with the wrong answer).

Hint 3

For Part 3, lead with the missing information before touching any formula. Under the null hypothesis that both classifiers share a common rate, use a pooled estimate of that rate to build the standard error. Work a concrete example with n = 100 per group, then derive the minimum n needed to reach significance.