Which practice most directly helps prevent data leakage when creating train/validation splits?

Answer

Randomly shuffle and split before performing scaling/encoding, then fit only on training data

Explanation

Fitting transformations only on the training set prevents information from leaking from validation into training. This ensures validation reflects real-world generalization.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list