How do you prevent target leakage across multiple tiers of stacked meta-learners?

Quick Overview

Asks how to keep the target from leaking through a stacked ensemble with several tiers of meta-learners. Tests how each tier's training features are produced, how folds and splitters handle groups and time, where target-dependent preprocessing is fit, and how the whole stack is evaluated honestly.

How do you prevent target leakage across multiple tiers of stacked meta-learners?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: hard

Interview Round: Other

You are building a stacked ensemble with several tiers: base models feed a tier-2 meta-learner, whose predictions feed a tier-3 meta-learner, and so on. How do you prevent target leakage across these tiers, both during training and when you estimate how well the whole stack performs? ```hint Where each feature came from For every meta-feature a tier is trained on, ask whether the model that produced it was trained on that row's label, directly or through another row. ``` ```hint Structure in the data Out-of-fold predictions only protect you if the folds really separate information. Think about repeated users or sessions, time order, and preprocessing steps that look at the target. ``` ```hint Measuring the whole stack Ask which data is left that no tier and no tuning choice ever touched, and how the meta-features for test rows are produced. ``` ### What a Strong Answer Covers - Why in-sample predictions leak the target into the next tier, and how out-of-fold predictions avoid it at every tier. - How fold assignment across tiers and base models affects leakage, including the indirect path that standard K-fold stacking leaves open and how to close it. - Splitters that respect groups and time order, and fitting target-dependent preprocessing inside folds. - A final hold-out that no tier or tuning decision touches. - How test-time meta-features are built so they match the distribution of the training meta-features. ### Follow-up Questions - How would you stack models on a time series, where the earliest fold has no out-of-fold predictions? - When would you choose blending on a separate hold-out set over K-fold stacking? - Your stack beats every base model in cross-validation but loses to the best base model on the hold-out. What do you check first? - How do you tune tier-2 hyperparameters without overfitting to the tier-1 out-of-fold predictions?

Overview: Asks how to keep the target from leaking through a stacked ensemble with several tiers of meta-learners. Tests how each tier's training features are produced, how folds and splitters handle groups and time, where target-dependent preprocessing is fit, and how the whole stack is evaluated honestly.

PracHub logo
General
Nov 25, 2026
hardMachine Learning EngineerOtherMachine Learning
0
0

You are building a stacked ensemble with several tiers: base models feed a tier-2 meta-learner, whose predictions feed a tier-3 meta-learner, and so on. How do you prevent target leakage across these tiers, both during training and when you estimate how well the whole stack performs?

What a Strong Answer Covers Guidance

  • Why in-sample predictions leak the target into the next tier, and how out-of-fold predictions avoid it at every tier.
  • How fold assignment across tiers and base models affects leakage, including the indirect path that standard K-fold stacking leaves open and how to close it.
  • Splitters that respect groups and time order, and fitting target-dependent preprocessing inside folds.
  • A final hold-out that no tier or tuning decision touches.
  • How test-time meta-features are built so they match the distribution of the training meta-features.

Follow-up Questions Guidance

  • How would you stack models on a time series, where the earliest fold has no out-of-fold predictions?
  • When would you choose blending on a separate hold-out set over K-fold stacking?
  • Your stack beats every base model in cross-validation but loses to the best base model on the hold-out. What do you check first?
  • How do you tune tier-2 hyperparameters without overfitting to the tier-1 out-of-fold predictions?