MLS-C01 Question 96
Select 2You are building a machine learning model to predict customer churn for a subscription-based business. Your dataset includes features such as 'Total Monthly Charges,' 'Customer Tenure in Months,' and 'Contract Type.' The feature 'Contract Type' is categorical with values 'Month-to-Month,' 'One Year,' and 'Two Year.' Which of the following feature engineering techniques should you use to prepare the 'Contract Type' feature for a machine learning model?
- A
One-hot encoding
- B
Label encoding
- C
Scaling using Min-Max normalization
- D
Imputation using the mean value
- E
Binarization based on a threshold
Show answer and explanation
Correct answers: A, B
Explanation
Categorical variables like 'Contract Type' need to be transformed into numerical representations before they can be used in machine learning models. Both one-hot encoding and label encoding are valid techniques for this. One-hot encoding is generally preferred when there is no ordinal relationship between categories, while label encoding can be useful for models that can interpret ordinal or categorical indices. The other options are unsuitable for preparing categorical variables.
- A. Correct.
One-hot encoding is a valid technique for categorical variables, especially when the categories do not have an ordinal relationship. It creates binary columns for each category, making it suitable for machine learning models.
- B. Correct.
Label encoding is another valid technique for categorical variables. It assigns a unique integer to each category, which can be useful for certain models that can interpret ordinal relationships or categorical indices.
- C. Incorrect.
Scaling using Min-Max normalization is not applicable here because 'Contract Type' is a categorical variable and scaling is typically used for numerical features.
- D. Incorrect.
Imputation using the mean value is irrelevant in this scenario, as there are no missing values mentioned for the 'Contract Type' feature.
- E. Incorrect.
Binarization based on a threshold is not appropriate because 'Contract Type' is not a numerical feature and does not have a threshold-based decision boundary.