EasyDeepLearn

How does KNN imputation work and when is it a good choice?

medium

Answer

  • For each row with missing values, find the k nearest complete rows using the observed features, then fill the missing values with a weighted average (regression) or mode (categorical) of those neighbours.
  • Handles multivariate structure automatically — better than mean/median for correlated features.
  • Downsides: quadratic in n (slow on large data), sensitive to scale (standardize first), degrades in high dimensions.
  • Great default for medium tabular data with < 100k rows.
Check yourself — multiple choice
  • It replaces missing values with the mean of the column
  • Fills missing values with the average of k nearest complete rows in observed-feature space
  • It requires labels
  • Only for regression targets

KNN imputation: average of k nearest complete rows using observed features.

#missing-data#knn

Practise Supervised Learning

215 interview questions in this topic.

Related questions