Data quality, labeling and cleaning: MLA-C02 study notes and practice questions
What to know about Data quality, labeling and cleaning for the MLA-C02 exam, from the Data Preparation for ML and AI domain (28% of the exam guide), then 1 free question to test it. Part of the MLA-C02 study guide.
Data quality questions ask how to stop bad records reaching training, or how to get accurate labels at reasonable cost.
Checking data
AWS Glue Data Quality rules written in DQDL check completeness, uniqueness, ranges and allowed values inside ETL jobs; a failed rule can stop the load or quarantine rows. Results go to CloudWatch and EventBridge.
Data Wrangler data quality and insights report flags duplicates, missing values, outliers, target leakage and class imbalance before training.
Glue DataBrew profile jobs give column statistics.
SageMaker Model Monitor later compares production data with training statistics.
Cleaning
Remove duplicates, especially across training and test sets.
Handle missing values by imputing or dropping.
Fix inconsistent formats and units.
Remove features that leak the label (such as a “refund issued” flag when predicting refunds).
Labeling with SageMaker Ground Truth
Built-in task types: image classification, bounding boxes, semantic segmentation, text classification, named entities, video and 3D point clouds, plus custom templates.
Workforces: Amazon Mechanical Turk (public, not for sensitive data), a private workforce of your own staff, or vendor workforces.
Automated data labeling uses active learning to label easy items with a model and sends uncertain ones to humans, cutting cost on large datasets.
Annotation consolidation combines several workers’ labels per item to improve accuracy.
Ground Truth Plus provides an expert workforce managed by AWS.
Human review in production
Amazon Augmented AI (A2I) routes low-confidence predictions (such as Textract or Rekognition results) to human reviewers.
Common traps
Mechanical Turk for confidential documents. Use a private workforce.
Labeling everything by hand at large scale when automated labeling helps.
Checking data quality weekly after bad records have already trained a model.
A dental chain loads visit records from 80 clinics into a data lake every night. A churn-prediction model is retrained from this table each week, and bad records have recently caused the model to train on missing patient IDs and duplicate visits.
The data engineers want rule checks that run inside the nightly AWS Glue ETL job, that stop the load and alert the team when a rule fails, and that use managed rules rather than custom code.
Which approach meets these requirements?
Choose one answer.
AA. Define a Glue Data Quality ruleset in DQDL for completeness and uniqueness, and evaluate it in the ETL job, set to fail the job on rule failure.
BB. Run a weekly SageMaker Processing job that loads the table into pandas and checks for missing values before retraining.
CC. Create a CloudWatch alarm on the number of rows written each night, and page the on-call team when the count changes sharply from the night before.
DD. Enable Amazon Macie on the data lake bucket so that it flags any records with missing patient IDs as sensitive findings.
Show the answer and explanation
Answer: A
A. Right: Correct. Glue Data Quality rulesets written in DQDL run inside the Glue ETL job, and the job can be set to fail without loading the target when a rule fails. The team uses managed rules with no custom code. Learn more: AWS Glue Data Quality (opens in a new tab)
B. Wrong: This checks data after the nightly load and only once a week, so bad data reaches the table first. It also requires custom code, which the stem rules out.
C. Wrong: A row count can change for many good reasons and does not detect missing patient IDs or duplicates. The check is too coarse for the stated problems.
D. Wrong: Macie looks for sensitive data types such as personal identifiers and does not check completeness or uniqueness of a table. It is the wrong tool for this data quality problem.
Explanation
Glue Data Quality rulesets written in DQDL can check completeness and uniqueness inside the ETL job, and a failed rule can stop the load before bad records reach the table. Weekly checks, row counts and Macie findings each miss either the timing or the kind of problem.
Want more on Data quality, labeling and cleaning? The 5 full-length practice sets have 8 more Data quality, labeling and cleaning questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →