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
Related questions
For causal inference on an observational dataset, which design most directly improves identification of the treatment effect when confounders are partially measured?
View question →
You must choose between two SQL approaches for cohort retention: (A) window functions on event-level rows; (B) pre-aggregated session tables. Under high cardinality and strict correctness for late-arriving events, which is most appropriate?
View question →
You need robust anomaly detection for streaming metrics where baselines drift weekly. Which modeling choice best captures time-varying seasonality while controlling false positives?
View question →
In a BigQuery ML classification pipeline, you observe severe class imbalance. Which strategy most directly addresses both imbalance and decision threshold calibration?
View question →
A team uses vector search to retrieve similar product descriptions for fraud scoring. Which evaluation method most directly tests whether retrieval improves downstream model performance?
View question →
In the described environment, which practice best protects data governance and reproducibility when producing a new KPI view from multiple sources?
View question →