Encoding Categorical Features with SageMaker Data Wrangler for the Fraud Detection Training Dataset
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?
Community Votes
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)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
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 →