AI engineering glossary · Feature engineering data prep
What is target encoding?
Target encoding (also called Mean encoding, Likelihood encoding): Replacing each category with a statistic of the target for that category, usually its mean, so one numeric column captures how predictive the category is. It handles many categories compactly but leaks target information unless computed out-of-fold or smoothed.
Target encoding: an example
If loans from Pincode 560001 default 4 percent of the time in training data, every row with that pincode gets the value 0.04.
Related terms
More Feature engineering data prep terms
- Text preprocessing
- Threshold tuning
- Tomek links
- Training-serving skew
- Undersampling
- Unit vector scaling
- Unknown category handling
- Variance threshold
Where you learn it
Target encoding is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.