Encoding Categorical Features with SageMaker Data Wrangler for the Fraud Detection Training Dataset

Answer Correct answer: C — Data Wrangler has a built-in categorical encoding transform, so no custom code is needed; Glue has no such managed transform.

Case study - An ML engineer is developing a fraud detection model on AWS. The training dataset includes transaction logs, customer profiles, and tables from an on-premises MySQL database. The transaction logs and customer profiles are stored in Amazon S3. The dataset has a class imbalance that affects the learning of the model's algorithm. Additionally, many of the features have interdependencies. The algorithm is not capturing all the desired underlying patterns in the data. The training dataset includes categorical data and numerical data. The ML engineer must prepare the training dataset to maximize the accuracy of the model. Which action will meet this requirement with the LEAST operational overhead?

  1. Use AWS Glue to transform the categorical data into numerical data.
  2. Use AWS Glue to transform the numerical data into categorical data.
  3. Use Amazon SageMaker Data Wrangler to transform the categorical data into numerical data. Correct Answer
  4. Use Amazon SageMaker Data Wrangler to transform the numerical data into categorical data.

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Data Wrangler ships a built-in categorical encoding transform supporting ordinal, one-hot, and similarity encoding, so the conversion needs no custom code, whereas AWS Glue has no managed categorical encoding transform and would require writing the logic yourself.

The fraud detection training dataset contains both categorical and numerical features and must be prepared to maximize model accuracy with the least operational overhead. Machine learning algorithms consume numbers, so the categorical features have to be turned into a numerical representation before training.

Choosing AWS Glue for the job because it is the general-purpose ETL service, or transforming the numerical data into categorical data. The direction of the conversion is fixed: categorical must become numerical, never the reverse, and Glue lacks the managed encoding transform.

Community Discussion (3 comments)

ninomfr64 👍 1 Selected: C
You need to transform category to numeric as ML model works with numbers, thus it is either A or C. Data Wrangler provides a builtin transformation to encode categorical data - https://docs.aws.amazon.com/sagemaker/latest/dg/data-wrangler-transform.html#data-wrangler-transform-cat-encode while Glue doesn't provide a managed transformation for encoding data - https://docs.aws.amazon.com/glue/latest/dg/edit-jobs-transforms.html
Pofmagic 👍 1 Selected: C
Data Wrangler can be used for encoding categorical data, i.e. the process of creating a numerical representation for categories. Categorical encoding encodes categorical data that is in string format into arrays of integers. Data Wrangler supports ordinal and a one-hot encoding, also similarity encoding (more advanced). https://docs.aws.amazon.com/sagemaker/latest/dg/data-wrangler-transform.html#data-wrangler-transform-cat-encode AWS Glue also has Data science recipe steps for One Hot Encoding and Categorical Mapping. https://docs.aws.amazon.com/databrew/latest/dg/recipe-actions.data-science.html However Data Wrangler is more user-friendly with visual and natural language interfaces for less operational overhead
GiorgioGss 👍 3 Selected: C
https://docs.aws.amazon.com/sagemaker/latest/dg/data-wrangler-transform.html

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The dataset contains categorical data and numerical data, and machine learning algorithms require a numerical representation, so the categorical features must be encoded into numbers. AWS Glue has no managed categorical encoding transform, so using it would mean writing and maintaining that logic yourself. SageMaker Data Wrangler instead includes a built-in categorical encoding transform that supports ordinal, one-hot, and similarity encoding, so the preparation happens with a configured transform and almost no code. That satisfies the least-operational-overhead requirement. The vote was unanimous at 100 for C. ninomfr64 eliminated the direction question first, observing that models work with numbers so only A or C remain, and then ruled out Glue for lacking a managed encoding transform, while Pofmagic described the three encoding methods Data Wrangler supports.

Why the Other Options Are Wrong

Using AWS Glue to transform numerical data into categorical data (B) reverses the required direction, destroying the usable numeric signal rather than preparing the dataset for a model. Using AWS Glue to transform categorical into numerical data (A) would work if the engineer wrote the encoding from scratch, but Glue provides no managed categorical encoding transform, so it carries more development effort than option C and directly contradicts the least-overhead requirement. Using Data Wrangler to transform numerical data into categorical data (D) has the same reversed-direction flaw as option B, discarding the numerical features the model actually needs.

Community Comment Notes

The community was unanimous, with all 100 votes for C and every substance comment in agreement. GiorgioGss, ninomfr64, and Pofmagic all cited the Data Wrangler transform documentation. ninomfr64 supplied the cleanest elimination, noting that categorical-to-numerical is the only valid direction and that Glue lacks a managed encoding transform, while Pofmagic listed the ordinal, one-hot, and similarity encoding options that Data Wrangler provides out of the box.

Official Reference

Related Analysis

Practice All MLA-C01 Questions

Access 115 questions with complete answers and detailed explanations.

View Full MLA-C01 Practice Test →

← Back to MLA-C01 Study Guide