KatInterview

Evaluating Feature Imputation Methods for Linear Regression Models

Machine LearningModel answer
MediumModel answerMachine Learningmachine-learningstatisticsdata-preprocessing

Last updated

Analyze and contrast mean imputation, empirical sample imputation, and missingness indicator techniques in linear models across MCAR, MAR, and MNAR data mechanisms.

You are building a linear regression pipeline where one of your continuous numerical inputs contains missing entries. You are considering three different approaches to handle these missing entries before fitting the model:

  1. Mean Imputation: Replace missing values with the mean of the non-missing training entries.
  2. Empirical Distribution Sampling: Replace missing values by randomly drawing with replacement from the observed non-missing training entries.
  3. Mean Imputation + Missingness Indicator: Replace missing values with the training mean while adding an extra binary column ($1$ if missing, $0$ otherwise).

Evaluate and compare these three techniques. In your analysis, address:

  • Statistical Impact: How each strategy alters feature marginal variance, covariance with other features, model coefficient estimates, and prediction variance.
  • Missingness Mechanisms: How each method performs when data is Missing Completely at Random (MCAR), Missing at Random (MAR), or Missing Not at Random (MNAR).
  • Data Leakage & Production: Guidelines for properly fitting and serving these imputers without introducing leakage across splits or production environments.

Hints

Hint 1

Consider how filling missing entries with a single constant value impacts the variance of the feature and its calculated covariance with correlated variables.

Hint 2

Distinguish between prediction tasks and parameter inference: adding a missingness indicator creates a piecewise-like continuous adjustment for linear models.

Hint 3

Recall that MAR implies missingness depends on observed features, whereas MNAR depends on unobserved values or the missing feature itself.