How do you evaluate a stacked ensemble without leaking information into the performance estimate?

Quick Overview

Asks how to measure the performance of a stacked ensemble so that no base model, meta-learner or tuning step sees the evaluation data. Tests understanding of out-of-fold predictions, nested cross-validation, hold-out design and the subtle leaks that inflate ensemble scores.

How do you evaluate a stacked ensemble without leaking information into the performance estimate?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: hard

Interview Round: Other

A stacked ensemble trains several base models, feeds their out-of-fold predictions to a meta-learner, and usually involves model selection and tuning along the way. How do you evaluate a stacked ensemble without leaking information into the performance estimate? ```hint Draw the boundary List every step that makes a choice using data, including preprocessing, model selection and tuning, and ask which rows each step saw. ``` ```hint Look past the meta-learner's inputs Out-of-fold predictions keep the meta-learner's training inputs clean. Think about what else still touches the data after they are made. ``` ```hint Check the split itself Consider whether a random split is valid when rows share a user or arrive over time. ``` ### What a Strong Answer Covers - Treating the whole stack, including selection and tuning, as one pipeline scored only on rows it never saw - The layout of nested cross-validation: an outer split for scoring and an inner split for out-of-fold predictions and tuning - The single hold-out alternative and its cost and variance trade-off - The common leaks: scoring on the meta-learner's own training predictions, selecting on evaluation data, preprocessing before splitting, and random splits on grouped or temporal data - Reporting uncertainty and comparing against simple averaging and the best single model under the same protocol ### Follow-up Questions - Nested cross-validation produces five differently tuned stacks. Which model do you ship, and what exactly does the nested score estimate? - How do you build out-of-fold predictions for a time-series problem where future rows must never inform past ones? - The stack beats the best single model by 0.3 AUC points. How do you decide whether that gain is real and worth the serving cost? - How can target encoding inside a base model leak the label, and how do you prevent it?

Overview: Asks how to measure the performance of a stacked ensemble so that no base model, meta-learner or tuning step sees the evaluation data. Tests understanding of out-of-fold predictions, nested cross-validation, hold-out design and the subtle leaks that inflate ensemble scores.

Nov 24, 2026
hardMachine Learning EngineerOtherMachine Learning
0
0

A stacked ensemble trains several base models, feeds their out-of-fold predictions to a meta-learner, and usually involves model selection and tuning along the way. How do you evaluate a stacked ensemble without leaking information into the performance estimate?

What a Strong Answer Covers Guidance

  • Treating the whole stack, including selection and tuning, as one pipeline scored only on rows it never saw
  • The layout of nested cross-validation: an outer split for scoring and an inner split for out-of-fold predictions and tuning
  • The single hold-out alternative and its cost and variance trade-off
  • The common leaks: scoring on the meta-learner's own training predictions, selecting on evaluation data, preprocessing before splitting, and random splits on grouped or temporal data
  • Reporting uncertainty and comparing against simple averaging and the best single model under the same protocol

Follow-up Questions Guidance

  • Nested cross-validation produces five differently tuned stacks. Which model do you ship, and what exactly does the nested score estimate?
  • How do you build out-of-fold predictions for a time-series problem where future rows must never inform past ones?
  • The stack beats the best single model by 0.3 AUC points. How do you decide whether that gain is real and worth the serving cost?
  • How can target encoding inside a base model leak the label, and how do you prevent it?