How would you impute missing data without leaking validation information?

Instruction: Training values are [10, 20, null]; validation values are [1000, null]. Use median imputation. State the fitted value and transformed splits. A new logging release also doubles the missing rate for one source. Explain what to investigate before trusting a missing-value indicator.

Context: A bounded preprocessing exercise separates training-only statistics, informative missingness, and source failures.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

Fit the imputer on the training split only: the median of 10 and 20 is 15. Transform training to [10, 20, 15] and validation to [1000, 15]. Fitting on both splits would use 20 and leak information about the validation distribution...

Related Questions