nerdexam
Google

PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #134

You are developing an ML model to predict house prices. While preparing the data, you discover that an important predictor variable, distance from the closest school, is often missing and does not…

The correct answer is C. Predict the missing values using linear regression. When an important predictor variable has missing values and low variance, and every data instance is crucial, predicting the missing values using a regression model is the most effective imputation strategy to retain data and maintain accuracy.

Submitted by miguelv· Apr 18, 2026Data processing and feature engineering

Question

You are developing an ML model to predict house prices. While preparing the data, you discover that an important predictor variable, distance from the closest school, is often missing and does not have high variance. Every instance (row) in your data is important. How should you handle the missing data?

Options

  • ADelete the rows that have missing values.
  • BApply feature crossing with another column that does not have missing values.
  • CPredict the missing values using linear regression.
  • DReplace the missing values with zeros.

How the community answered

(45 responses)
  • A
    2% (1)
  • B
    9% (4)
  • C
    84% (38)
  • D
    4% (2)

Why each option

When an important predictor variable has missing values and low variance, and every data instance is crucial, predicting the missing values using a regression model is the most effective imputation strategy to retain data and maintain accuracy.

ADelete the rows that have missing values.

Deleting rows with missing values would result in losing important instances, which the problem explicitly states is undesirable ('Every instance (row) in your data is important').

BApply feature crossing with another column that does not have missing values.

Applying feature crossing creates new features from existing ones but does not directly address or impute the missing values in the original important predictor variable.

CPredict the missing values using linear regression.Correct

Since 'distance from the closest school' is an important predictor, every instance is crucial, and the feature does not have high variance, predicting the missing values using a regression model (like linear regression with other features) is a sophisticated imputation method. This approach leverages the relationships between features to provide more accurate estimates than simple replacements, thus retaining valuable rows without introducing significant bias.

DReplace the missing values with zeros.

Replacing the missing values with zeros can introduce significant bias, especially if zero is not a semantically meaningful value for 'distance from closest school,' and can distort the feature's distribution, leading to incorrect model learning.

Concept tested: Missing data imputation strategies

Topics

#Missing data#Data imputation#Data preprocessing#Feature engineering

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice