AI engineering glossary · Feature engineering data prep
What is k-fold target encoding?
K-fold target encoding: Computing target encoding values for each fold using only the other folds' data, so a row's encoding never uses its own label. This out-of-fold approach makes the encoded feature safer and gives a more honest estimate on validation data.
K-fold target encoding: an example
With 5 folds, rows in fold 1 get city means calculated from folds 2 to 5 only, and the same is done for every other fold.
Related terms
More Feature engineering data prep terms
- KNN imputation
- Kurtosis
- Label encoding
- Lag feature
- Last observation carried forward
- Leave-one-out encoding
- Lemmatization
- Listwise deletion
Where you learn it
K-fold 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.