MLS-C01 Question 67
Select 3You are working on a machine learning project for a retail company and are tasked with identifying patterns in customer purchasing behavior. The dataset contains categorical features such as 'Product_Category', 'Customer_Segment', and 'Region', as well as numerical features like 'Purchase_Amount' and 'Discount_Applied'. During the exploratory data analysis (EDA) phase, you notice that the 'Purchase_Amount' feature contains many extreme values. What would be the most appropriate steps to handle this issue?
- A
Calculate and visualize the distribution of 'Purchase_Amount' using a box plot or histogram to identify outliers.
- B
Normalize or scale the 'Purchase_Amount' feature to ensure the extreme values do not dominate model training.
- C
Directly remove all rows with extreme values in 'Purchase_Amount' to clean the dataset.
- D
Use a log transformation or another mathematical function to reduce the impact of extreme values on 'Purchase_Amount'.
- E
Replace the extreme values in 'Purchase_Amount' with the median of the feature to minimize their influence.
Show answer and explanation
Correct answers: A, B, D
Explanation
Handling extreme values in numerical features like 'Purchase_Amount' requires a combination of understanding their distribution and applying appropriate techniques to minimize their impact. Visualizing the data helps identify the presence and extent of outliers, while normalization or transformations can address the issue without arbitrarily discarding data. Techniques like replacing extreme values with the median should only be used when the outliers are confirmed to be erroneous or invalid.
- A. Correct.
Correct. Visualizing the distribution of 'Purchase_Amount' using a box plot or histogram is a critical first step in identifying and understanding outliers.
- B. Correct.
Correct. Normalizing or scaling the feature is a common practice to ensure that extreme values do not disproportionately influence model training.
- C. Incorrect.
Incorrect. Directly removing rows with extreme values without analysis may result in the loss of valuable data and should not be done without justification.
- D. Correct.
Correct. Applying a log transformation or a similar method can help reduce the skewness caused by extreme values and make the feature more suitable for modeling.
- E. Incorrect.
Incorrect. While replacing extreme values with the median is a possible approach, it may oversimplify the data and result in a loss of useful information, especially if the extreme values are valid data points.