AI engineering glossary · Feature engineering data prep

What is leave-one-out encoding?

Leave-one-out encoding: A form of target encoding where each row's category value is the target mean of all other rows in that category, excluding the row itself. This reduces direct target leakage, though it can still leak subtly and can be exploited by trees.

Level: advancedTopic: Feature engineering data prep

Leave-one-out encoding: an example

For a city with 4 rows having targets 1, 0, 1, 1, the first row is encoded as (0 + 1 + 1) / 3 = 0.67.

Related terms

More Feature engineering data prep terms

Where you learn it

Leave-one-out 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.