How does averaging a metric across folds differ from computing it on pooled out-of-fold predictions?

Quick Overview

Asks how averaging a metric across cross-validation folds differs from computing it once on pooled out-of-fold predictions. Tests which metrics give the same result both ways, why ratio and ranking metrics such as precision and AUC diverge, and which approach fits model comparison, thresholds and calibration.

How does averaging a metric across folds differ from computing it on pooled out-of-fold predictions?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is the difference between averaging metric scores across folds and computing the metric on pooled out-of-fold predictions? ```hint Write both as formulas Write each approach out for a metric that is a mean of per-sample losses, then for a ratio such as precision, and see where the two stop matching. ``` ```hint One list, several models Think about what happens to a ranking metric when scores produced by different fold models are sorted together on one list. ``` ### What a Strong Answer Covers - The two procedures stated precisely, including what each returns. - When the two agree exactly and when they diverge, by type of metric. - The main failure mode of each approach. - Which approach to use for model comparison, threshold selection, calibration and stacking, and why the report should say which one was used. ### Follow-up Questions - With equal-sized folds, which is larger: the mean of the fold RMSEs or the RMSE of the pooled predictions? - Why does the standard deviation of fold scores understate the uncertainty of a cross-validated estimate? - One fold contains no positive examples. What happens to each approach when the metric is AUC? - How would you choose a classification threshold from cross-validation without leaking information into the estimate?

Overview: Asks how averaging a metric across cross-validation folds differs from computing it once on pooled out-of-fold predictions. Tests which metrics give the same result both ways, why ratio and ranking metrics such as precision and AUC diverge, and which approach fits model comparison, thresholds and calibration.

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

What is the difference between averaging metric scores across folds and computing the metric on pooled out-of-fold predictions?

What a Strong Answer Covers Guidance

  • The two procedures stated precisely, including what each returns.
  • When the two agree exactly and when they diverge, by type of metric.
  • The main failure mode of each approach.
  • Which approach to use for model comparison, threshold selection, calibration and stacking, and why the report should say which one was used.

Follow-up Questions Guidance

  • With equal-sized folds, which is larger: the mean of the fold RMSEs or the RMSE of the pooled predictions?
  • Why does the standard deviation of fold scores understate the uncertainty of a cross-validated estimate?
  • One fold contains no positive examples. What happens to each approach when the metric is AUC?
  • How would you choose a classification threshold from cross-validation without leaking information into the estimate?