In feature engineering, you transform categorical variables using target encoding. Under what condition is it most likely to leak information?

Answer

You compute category means over the entire dataset before splitting

Explanation

If category statistics are computed on the full dataset, they incorporate information from the evaluation set. That contaminates validation and inflates measured performance.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list