How does KNN imputation fill in missing values?

Quick Overview

Asks how k-nearest-neighbor imputation fills missing values in a feature matrix. Tests how distances are measured over incomplete rows, how donor values are combined, and the scaling, leakage and cost issues that come up in practice.

How does KNN imputation fill in missing values?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

How does KNN imputation fill in missing values? ```hint Distances with gaps Think about how you measure the distance between two rows when either one may have missing entries, and which rows are allowed to donate a value for the feature you are filling. ``` ### What a Strong Answer Covers - How neighbors are found when rows themselves have missing values - Which rows can act as donors and how their values are combined - Why scaling matters and how to avoid leaking test data into the imputer - The computational cost and the assumption about why values are missing ### Follow-up Questions - How would you choose k for imputation? - What goes wrong if values are missing not at random? - How does KNN imputation compare with iterative, regression-based imputation? - How would you run KNN imputation on tens of millions of rows?

Overview: Asks how k-nearest-neighbor imputation fills missing values in a feature matrix. Tests how distances are measured over incomplete rows, how donor values are combined, and the scaling, leakage and cost issues that come up in practice.

PracHub logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

How does KNN imputation fill in missing values?

What a Strong Answer Covers Guidance

  • How neighbors are found when rows themselves have missing values
  • Which rows can act as donors and how their values are combined
  • Why scaling matters and how to avoid leaking test data into the imputer
  • The computational cost and the assumption about why values are missing

Follow-up Questions Guidance

  • How would you choose k for imputation?
  • What goes wrong if values are missing not at random?
  • How does KNN imputation compare with iterative, regression-based imputation?
  • How would you run KNN imputation on tens of millions of rows?