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

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?
C) Replace the missing values with a placeholder category indicating a missing value.
A) Remove the rows with missing values, and upsample your dataset by 5%.
B) Replace the missing values with the feature's mean.
D) Move the rows with missing values to your validation dataset.

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

Actual exam question for Google's Professional Machine Learning Engineer exam
Question #: 116
Topic #: 2
[All Professional Machine Learning Engineer Questions]

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?

Show Suggested Answer Hide Answer
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


Contribute your Thoughts:

0/2000 characters
Kris
4 days ago
Replacing with mean is not ideal for categorical features!
upvoted 0 times
...
Brittni
9 days ago
Wait, why would you upsample just because of 5% nulls?
upvoted 0 times
...
Laila
14 days ago
I disagree, removing rows might lose important info.
upvoted 0 times
...
Skye
19 days ago
C seems like a good option to indicate missing data.
upvoted 0 times
...
Nadine
24 days ago
D could work, but it feels like you're just pushing the problem away.
upvoted 0 times
...
Louisa
29 days ago
Replacing with mean is a bad idea, it can skew the data.
upvoted 0 times
...
Johnson
1 month ago
Wait, why would you upsample just because of 5% nulls?
upvoted 0 times
...
Skye
1 month ago
I disagree, removing rows might lead to loss of important info.
upvoted 0 times
...
Sylvia
1 month ago
C seems like a good option to keep the data intact.
upvoted 0 times
...
Kip
2 months ago
Moving rows to the validation set seems risky; I feel like it could introduce bias in model evaluation.
upvoted 0 times
...
Erick
2 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.
upvoted 0 times
...
Tamala
2 months ago
I think replacing with the mean is not ideal for categorical data, right? It seems more suited for numerical features.
upvoted 0 times
...
Lashawna
4 months ago
I remember we discussed that removing rows can lead to loss of valuable data, especially if it's only 5%.
upvoted 0 times
...

Save Cancel