Google Professional Machine Learning Engineer Question 210
Select 3Google Cloud PlatformYou are building a machine learning model to predict customer churn for a subscription-based service. The dataset contains categorical variables such as 'Subscription Type' and 'Region' in addition to numerical variables like 'Monthly Spend' and 'Tenure'. Which of the following considerations are most important when preparing the data and building the model to ensure optimal performance?
- A
One-hot encode categorical variables such as 'Subscription Type' and 'Region' to allow the model to process them effectively.
- B
Normalize the numerical variables to ensure they have a mean of 0 and a standard deviation of 1.
- C
Drop the 'Region' feature because it is a categorical variable and may complicate the training process.
- D
Assess feature importance to identify if any features, such as 'Tenure', have low correlation with churn and can be removed.
- E
Ensure the dataset is balanced in terms of churned vs. non-churned customers to avoid model bias.
Show answer and explanation
Correct answers: A, B, E
Explanation
When building machine learning models, it is critical to preprocess the data correctly. This includes encoding categorical variables (e.g., one-hot encoding), scaling numerical data for models that require it, and addressing imbalanced datasets to ensure fair predictions. Dropping features or assessing their importance requires careful evaluation, and decisions should not be based solely on correlation or data type without proper analysis.
- A. Correct.
One-hot encoding categorical variables allows the model to understand and process these non-numerical features effectively without introducing ordinal relationships that do not exist.
- B. Correct.
Normalization of numerical variables ensures that features with large ranges do not dominate the model training process, particularly for models sensitive to feature scaling like logistic regression or neural networks.
- C. Incorrect.
Dropping categorical variables like 'Region' without assessing their impact on the model can result in loss of potentially valuable information for prediction.
- D. Incorrect.
While assessing feature importance is useful, low correlation does not always imply a feature is irrelevant, especially in non-linear models. Removing features based solely on correlation can lead to suboptimal model performance.
- E. Correct.
Balancing the dataset helps prevent the model from being biased toward the majority class, ensuring better generalization and accuracy on the minority class (churned customers in this case).