MLS-C01 Question 72
Select 4You are working on a machine learning project that involves predicting customer churn. The dataset contains several features, including categorical features like 'Customer Region' and 'Subscription Type', as well as numerical features like 'Monthly Charges' and 'Tenure'. Additionally, the dataset has missing values in some of the numerical columns and inconsistent capitalization in categorical values. What actions should you take to sanitize and prepare the data for modeling?
- A
Impute missing numerical values using an appropriate technique, such as mean or median.
- B
Normalize all numerical features to ensure they are on the same scale.
- C
One-hot encode categorical variables such as 'Customer Region' and 'Subscription Type' to convert them into numerical format.
- D
Remove rows with missing values to avoid introducing bias into the model.
- E
Standardize capitalization in categorical features to ensure consistency.
Show answer and explanation
Correct answers: A, B, C, E
Explanation
Data sanitization and preparation are crucial steps in the machine learning pipeline. For this scenario, imputing missing values ensures the dataset is complete, while normalization and one-hot encoding prepare the data for modeling. Standardizing categorical feature capitalization ensures consistency, improving the quality of the data. Removing rows with missing values, however, is not ideal as it may lead to significant information loss.
- A. Correct.
Correct: Imputing missing numerical values is a key part of data sanitization to ensure the model can handle incomplete data. Techniques like mean or median imputation are commonly used.
- B. Correct.
Correct: Normalizing numerical features helps ensure that they are on a consistent scale, which is crucial for many machine learning algorithms, such as gradient descent-based models.
- C. Correct.
Correct: One-hot encoding is a standard technique for handling categorical variables in machine learning. It transforms categorical data into a numerical format that models can work with.
- D. Incorrect.
Incorrect: Removing rows with missing values is generally not recommended unless the missing data is minimal. This approach can lead to loss of valuable information.
- E. Correct.
Correct: Standardizing capitalization in categorical features ensures consistency, which is important for accurate encoding and processing of the data.