AI engineering glossary · Feature engineering data prep
What is KNN imputation?
KNN imputation (also called KNNImputer): Filling a missing value using the values of the k most similar rows, where similarity is measured on the other features, typically by averaging their values. It respects local patterns but is slower and needs scaled features.
KNN imputation: an example
A missing salary is filled with the average salary of the 5 customers closest in age, city and job level.
Related terms
More Feature engineering data prep terms
- Kurtosis
- Label encoding
- Lag feature
- Last observation carried forward
- Leave-one-out encoding
- Lemmatization
- Listwise deletion
- Log transform
Where you learn it
KNN imputation is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.