MLA-C01 Question 53
Select 2You are working on a machine learning pipeline for a customer churn prediction model. During data preprocessing, you notice that the dataset contains several missing values in the 'LastTransactionAmount' column and extreme outliers in the 'MonthlySpend' column. What steps should you take to prepare the data for training while minimizing data quality issues?
- A
Impute missing values in the 'LastTransactionAmount' column using the median of the column.
- B
Remove rows with missing values in the 'LastTransactionAmount' column to ensure data consistency.
- C
Use quantile-based flooring and capping to handle the outliers in the 'MonthlySpend' column.
- D
Normalize the 'MonthlySpend' column by scaling it to a range of 0-1 without addressing the outliers.
- E
Replace missing values in the 'LastTransactionAmount' column with zeros.
- F
Remove rows with extreme outliers in the 'MonthlySpend' column to ensure the dataset remains clean.
Show answer and explanation
Correct answers: A, C
Explanation
When dealing with missing data, imputing with the median is a robust approach that avoids data loss while maintaining the column's distribution. For outliers, quantile-based flooring and capping is a preferred method as it mitigates their effects without removing them entirely, preserving the dataset's integrity and size. These techniques align with best practices for data cleaning and transformation in machine learning pipelines.
- A. Correct.
Imputing missing values using the median is a common and effective technique, especially for numerical data, as it is robust to outliers and maintains the overall data distribution.
- B. Incorrect.
Removing rows with missing values may result in significant data loss, especially if the column has many missing entries. This approach should generally be avoided unless the missing data is minimal.
- C. Correct.
Quantile-based flooring and capping is an effective method to handle outliers without removing them entirely, ensuring that the data distribution is preserved while mitigating the effects of extreme values.
- D. Incorrect.
Normalizing the 'MonthlySpend' column without addressing the outliers would propagate the effects of the outliers into the scaled data, potentially skewing the model's performance.
- E. Incorrect.
Replacing missing values with zeros can introduce bias into the dataset, as zeros may not accurately represent the missing values' potential distribution.
- F. Incorrect.
Removing rows with extreme outliers can result in significant data loss and should generally be avoided unless the outliers are proven to be erroneous.