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.

Level: intermediateTopic: Feature engineering data prep

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

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.

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.