MLS-C01 Question 69
Select 3You are working on a machine learning project to predict customer churn for a telecommunications company. The dataset contains customer demographic information, usage statistics, and churn labels. While preparing the data for modeling in Amazon SageMaker, you notice that the MonthlyCharges column contains missing values, and the CustomerID column is a unique identifier for each customer. What steps should you take to properly sanitize and prepare this dataset for modeling?
- A
Fill the missing values in the
MonthlyChargescolumn with the mean of the column. - B
Drop the
CustomerIDcolumn from the dataset. - C
Fill the missing values in the
MonthlyChargescolumn with zeros. - D
Convert the
CustomerIDcolumn into a one-hot encoded feature. - E
Normalize the
MonthlyChargescolumn after handling missing values.
Show answer and explanation
Correct answers: A, B, E
Explanation
To sanitize and prepare the dataset for modeling, you should handle missing values in the MonthlyCharges column appropriately, such as filling them with the mean, to prevent data loss. The CustomerID column is a unique identifier and does not contribute to the predictive power of the model, so it should be dropped. Finally, normalizing numerical features like MonthlyCharges ensures they are on the same scale, which is critical for many machine learning algorithms. Filling missing values with zeros or one-hot encoding the CustomerID column are not proper data preparation techniques in this scenario.
- A. Correct.
Filling missing values with the mean is a standard technique to handle missing data for numerical features, ensuring you retain the data without introducing large biases.
- B. Correct.
The
CustomerIDcolumn is a unique identifier and does not provide meaningful information for the model. Including it as a feature would add noise rather than predictive power, so it should be dropped. - C. Incorrect.
Filling missing values with zeros may introduce bias, as zeros could be interpreted as meaningful values by the model, which is inappropriate in this context.
- D. Incorrect.
Converting the
CustomerIDcolumn into a one-hot encoded feature is not appropriate because it would generate a high-dimensional sparse matrix without providing meaningful information for the model. - E. Correct.
Normalization of numerical features such as
MonthlyChargesis an important step, especially for algorithms sensitive to feature scaling, like gradient-boosted trees or neural networks.