AI-900 Fundamental principles of machine learning on Azure

An Azure Machine Learning designer pipeline imputes missing values with the column mean and must report trustworthy test metrics. Where should the imputation be fitted?

Show answer and explanation

Answer: B

Imputation values are learned from data, so they are part of the model. Computing them from every row before splitting lets statistics from the test partition influence training, which is data leakage and produces optimistic metrics. The sound pattern is to split first, fit the replacement values on training rows only, and then apply that same transformation to validation and test rows, so the evaluation reflects what would happen to genuinely unseen data.

Why the other options are wrong

  • A. Fitting on all rows before splitting is the leakage this design must avoid: test-set statistics reach the training process.
  • C. Using each partition's own mean makes the test treatment differ from training and hides how the model copes with unseen distributions.
  • D. Fitting only on test data leaves training records handled differently and still leaks test information into the evaluation setup.

Exam tip. Anything learned from data, including imputation values, is fitted on training only and then applied to the other splits.

Keep going. 195 AI-900 questions, answers explained after each one.

Practise this domain

Reviewed November 2026. Spotted a problem with this question? Report it from the practice tool.