Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Professional Machine Learning Engineer Exam - Topic 2 Question 116 Discussion

Posted by Gail on May 14, 2026 at 09:13 PM

While performing exploratory data analysis on a dataset, you find that an important categorical feature has 5% null values. You want to minimize the bias that could result from the missing values. How should you handle the missing values?

Suggested Answer: C

The best option for handling missing values in a categorical feature is to replace them with a placeholder category indicating a missing value. This is a type of imputation, which is a method of estimating the missing values based on the observed data. Imputing the missing values with a placeholder category preserves the information that the data is missing, and avoids introducing bias or distortion in the feature distribution. It also allows the machine learning model to learn from the missingness pattern, and potentially use it as a predictor for the target variable. The other options are not suitable for handling missing values in a categorical feature, because:

Removing the rows with missing values and upsampling the dataset by 5% would reduce the size of the dataset and potentially lose important information. It would also introduce sampling bias and overfitting, as the upsampling process would create duplicate or synthetic observations that do not reflect the true population.

Replacing the missing values with the feature's mean would not make sense for a categorical feature, as the mean is a numerical measure that does not capture the mode or frequency of the categories. It would also create a new category that does not exist in the original data, and might confuse the machine learning model.

Moving the rows with missing values to the validation dataset would compromise the validity and reliability of the model evaluation, as the validation dataset would not be representative of the test or production data. It would also reduce the amount of data available for training the model, and might introduce leakage or inconsistency between the training and validation datasets.Reference:

Imputation of missing values

Effective Strategies to Handle Missing Values in Data Analysis

How to Handle Missing Values of Categorical Variables?

Google Cloud launches machine learning engineer certification

Google Professional Machine Learning Engineer Certification

Professional ML Engineer Exam Guide

Preparing for Google Cloud Certification: Machine Learning Engineer Professional Certificate


Get Premium Professional Machine Learning Engineer Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
24 comments · newest first
ST
Stephanie 2 days ago
I feel like B is too simplistic. Mean doesn't fit categorical data.
BL
Blondell 8 days ago
Option A seems risky. Removing rows could lose important info.
AN
Antonio 13 days ago
I agree, C makes sense. It shows missing values clearly.
HO
Hollis 18 days ago
I think option C is the best. It keeps all data intact.
JE
Jesus 23 days ago
C is safe. It avoids losing valuable data.
LA
Laurel 28 days ago
D might work, but validation set needs full data.
JE
Jenise 1 month ago
B is not good. Mean doesn't fit categorical data.
GA
Gail 1 month ago
Removing rows seems risky. A could lead to bias.
GE
German 1 month ago
I agree, C makes sense. Placeholder shows missing info.
NA
Natalie 2 months ago
I think option C is best. It keeps all data intact.
JO
Jonell 2 months ago
D could work, but it feels risky to shift missing data like that.
KR
Kris 2 months ago
Replacing with mean is not ideal for categorical features!
BR
Brittni 2 months ago
Wait, why would you upsample just because of 5% nulls?
LA
Laila 2 months ago
I disagree, removing rows might lose important info.
SK
Skye 2 months ago
C seems like a good option to indicate missing data.
NA
Nadine 3 months ago
D could work, but it feels like you're just pushing the problem away.
LO
Louisa 3 months ago
Replacing with mean is a bad idea, it can skew the data.
JO
Johnson 3 months ago
Wait, why would you upsample just because of 5% nulls?
SK
Skye 3 months ago
I disagree, removing rows might lead to loss of important info.
SY
Sylvia 3 months ago
C seems like a good option to keep the data intact.
KI
Kip 4 months ago
Moving rows to the validation set seems risky; I feel like it could introduce bias in model evaluation.
ER
Erick 4 months ago
Using a placeholder category sounds like a good option to indicate missing values, but I’m not sure how it might affect the analysis later.
TA
Tamala 4 months ago
I think replacing with the mean is not ideal for categorical data, right? It seems more suited for numerical features.
LA
Lashawna 5 months ago
I remember we discussed that removing rows can lead to loss of valuable data, especially if it's only 5%.
0/2000 characters

Save Cancel