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.

Level: intermediateTopic: Feature engineering data prep

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.