A team encodes the categorical variable 'state' (50 categories) by replacing each state with the average default rate computed on training data. What encoding method is this, and what is its primary risk?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — c is correct because target encoding replaces categories with the mean of the target variable, and if not done properly (e.g., using the full training set including the current row, or leaking test fold statistics), it introduces target leakage. A (one-hot) creates binary indicators and doesn't use target information.
Full explanation below image
Full Explanation
C is correct because target encoding replaces categories with the mean of the target variable, and if not done properly (e.g., using the full training set including the current row, or leaking test fold statistics), it introduces target leakage. A (one-hot) creates binary indicators and doesn't use target information. B (label encoding) assigns arbitrary integers. D (frequency encoding) uses category counts, not mean target values.