When would you use McNemar's test to compare two classifiers?

Quick Overview

Asks when McNemar's test is the right way to compare two classifiers evaluated on the same test set. Tests how the paired 2×2 table and discordant counts drive the statistic, when to use the exact version, and which metrics and evaluation setups need a different test.

When would you use McNemar's test to compare two classifiers?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

When would you use McNemar's test to compare two classifiers? ```hint Use the pairing Both models predict on the same examples. Think about which examples actually carry information about which model is better. ``` ```hint Know where it stops Consider what kind of outcome per example the test needs, and what source of variation it leaves out when you evaluate a single trained model of each kind. ``` ### What a Strong Answer Covers - The setting where the test applies - How the 2×2 table is built, which cells the statistic uses, and the statistic itself - When to switch to the exact binomial version - Why a paired test has more power than comparing two accuracies independently - The test's limitations and what to use instead ### Follow-up Questions - Model A scores 85% and model B 83% on the same 1,000 test examples. What else do you need before calling the difference significant? - How would you compare the two models on AUC or F1 instead of accuracy? - How would you compare more than two classifiers on the same test set? - What goes wrong if the test examples are grouped, such as several images from each patient?

Overview: Asks when McNemar's test is the right way to compare two classifiers evaluated on the same test set. Tests how the paired 2×2 table and discordant counts drive the statistic, when to use the exact version, and which metrics and evaluation setups need a different test.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

When would you use McNemar's test to compare two classifiers?

What a Strong Answer Covers Guidance

  • The setting where the test applies
  • How the 2×2 table is built, which cells the statistic uses, and the statistic itself
  • When to switch to the exact binomial version
  • Why a paired test has more power than comparing two accuracies independently
  • The test's limitations and what to use instead

Follow-up Questions Guidance

  • Model A scores 85% and model B 83% on the same 1,000 test examples. What else do you need before calling the difference significant?
  • How would you compare the two models on AUC or F1 instead of accuracy?
  • How would you compare more than two classifiers on the same test set?
  • What goes wrong if the test examples are grouped, such as several images from each patient?