MLA-C01 exam dumps

MLA-C01 practice question 60 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 60

Single answer

A data scientist is building a machine learning model to predict customer churn. The dataset includes a categorical feature 'Region' with values 'North', 'South', 'East', and 'West'. The target variable is binary: 0 for 'No Churn' and 1 for 'Churn'. Which encoding technique is most appropriate to transform the 'Region' feature for input into a tree-based model such as XGBoost?

  1. A

    One-hot encoding

  2. B

    Label encoding

  3. C

    Binary encoding

  4. D

    Tokenization

Show answer and explanation

Correct answer: B

Explanation

Tree-based models like XGBoost can handle categorical features effectively using label encoding, as they evaluate splits based on the feature's numeric representation without requiring distance-based relationships. One-hot encoding, while useful for linear models, could unnecessarily increase feature dimensionality for tree-based models, leading to inefficiency. Binary encoding is more suitable for high cardinality features, and tokenization is specific to text processing, making label encoding the most appropriate choice for the given scenario.

  • A. Incorrect.

    One-hot encoding creates a new binary feature for each category, but for tree-based models like XGBoost, this can introduce sparsity without providing significant benefits, as these models are not sensitive to distance-based relationships between categories.

  • B. Correct.

    Label encoding assigns a numeric value to each category and is well-suited for tree-based models like XGBoost, which can naturally handle categorical splits without requiring one-hot encoded features.

  • C. Incorrect.

    Binary encoding is a hybrid approach that reduces dimensionality by representing categories with binary digits. While it can be effective for high cardinality features, it is unnecessary for a feature with only four categories like 'Region'.

  • D. Incorrect.

    Tokenization is a technique primarily used for processing text data, where it splits text into smaller units such as words or subwords. It is not applicable for encoding categorical variables like 'Region'.

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