MLA-C01 exam dumps

MLA-C01 practice question 126 of 458

AWS Certified Machine Learning Engineer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

MLA-C01 Question 126

Select 2

You are building a machine learning model to predict customer churn for a subscription-based service. The dataset contains categorical variables such as 'Subscription_Type' and 'Customer_Region.' During the preprocessing stage, you need to encode these categorical features for use in a machine learning algorithm like XGBoost. Which of the following techniques are most appropriate for encoding these features?

  1. A

    One-Hot Encoding

  2. B

    Label Encoding

  3. C

    Frequency Encoding

  4. D

    Binary Encoding

  5. E

    Ordinal Encoding

Show answer and explanation

Correct answers: A, B

Explanation

For categorical variables in machine learning, One-Hot Encoding and Label Encoding are the two most appropriate techniques for models like XGBoost. One-Hot Encoding is suitable for non-ordinal variables and ensures no ordinal relationships are introduced. Label Encoding is also valid as XGBoost inherently handles integer values without assuming order. Other techniques like Frequency Encoding, Binary Encoding, and Ordinal Encoding are less commonly used or not applicable for the given scenario.

  • A. Correct.

    One-Hot Encoding is a common technique for encoding categorical variables where each category is represented as a binary vector. It is especially useful for non-ordinal categorical variables and models like XGBoost that can handle sparse data efficiently.

  • B. Correct.

    Label Encoding assigns a unique integer to each category. While it is simpler and more memory-efficient than One-Hot Encoding, it may introduce ordinal relationships between categories that do not actually exist. XGBoost can handle encoded integers correctly without assuming order.

  • C. Incorrect.

    Frequency Encoding assigns a value to each category based on its frequency in the dataset. While useful for some algorithms, it is less commonly used and may not always be ideal for tree-based models like XGBoost.

  • D. Incorrect.

    Binary Encoding converts categories into binary format and is more memory-efficient than One-Hot Encoding. However, it is not as commonly used or supported as One-Hot and Label Encoding for tree-based models.

  • E. Incorrect.

    Ordinal Encoding is only appropriate for categorical variables that have a meaningful order. Since 'Subscription_Type' and 'Customer_Region' do not have inherent order, this encoding method is not suitable here.

Timed practice exam

Take a MLA-C01 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam