An engineer uses five-fold cross-validation to evaluate a model that requires standardized numerical features. Each validation fold must represent unseen data, including during preprocessing. How should the engineer calculate and apply the scaling statistics?
Show the answer
Correct answerA. Fit on each training fold; transform its training and validation data.
AWhy this is right: Training-only statistics avoid leakage and give training and validation data the same transformation within each fold.
BWhy not this: Independent fitting uses validation information and gives validation data a different feature transformation.
CWhy not this: The first training partition contains records used for validation in other folds, causing leakage in those folds.
DWhy not this: Whole-dataset statistics expose preprocessing to the validation values before evaluation.
Each fold must learn its mean and standard deviation only from its training partition, then apply them to both partitions. Fitting before splitting leaks validation information into preprocessing and compromises the evaluation.