Curated

Data Preparation for ML and AI 2 (1.3)

0 votes

Questions24

  1. Question 1

    Data Preparation for ML and AI

    An engineer is configuring an Amazon SageMaker Ground Truth labeling job for road images. The model needs every pixel classified as road, vehicle, pedestrian, or background; which task type should the engineer choose?

    Show the answer

    Correct answerC. Semantic segmentation

    AWhy not this: Image classification assigns labels to whole images rather than individual pixels.

    BWhy not this: Bounding boxes enclose objects but include pixels outside their exact boundaries.

    CWhy this is right: Semantic segmentation supplies a class label for every pixel in an image.

    DWhy not this: Keypoints mark selected locations on objects rather than classifying every pixel.

    Semantic segmentation assigns a class to each pixel. Bounding boxes locate objects with rectangles but do not provide the pixel-level boundaries required here.

    Open this question
  2. Question 2

    Data Preparation for ML and AI

    Every order has a non-null customer_id with the expected type, but some IDs do not exist in the customer reference table. Which AWS Glue Data Quality rule type should detect this defect?

    Show the answer

    Correct answerB. ReferentialIntegrity

    AWhy not this: Distinctness does not establish whether customer IDs exist in the reference table.

    BWhy this is right: It checks whether order customer IDs match values in the customer reference dataset.

    CWhy not this: A customer ID can have the expected data type without identifying an existing customer.

    DWhy not this: Non-null customer IDs pass completeness checks even when they identify nonexistent customers.

    ReferentialIntegrity checks whether values in a dataset exist in a reference dataset. IsComplete only checks for nulls, so populated but nonexistent customer IDs can pass it.

    Open this question
  3. Question 3

    Data Preparation for ML and AI

    A training pipeline must reject batches when more than 2% of customer_age values are null, without modifying the records. Which AWS Glue Data Quality check should the engineer configure?

    Show the answer

    Correct answerB. A completeness check with a minimum of 98%

    AWhy not this: Repeated ages are valid; uniqueness does not measure the proportion of non-null ages.

    BWhy this is right: At least 98% non-null values means no more than 2% of values are null.

    CWhy not this: An average can remain acceptable even when too many records have null values.

    DWhy not this: A batch can have the expected number of rows while containing too many null ages.

    Completeness measures the proportion of non-null values, so a minimum of 98% enforces the requirement. Uniqueness measures distinctness, not whether values are missing.

    Open this question
  4. Question 4

    Data Preparation for ML and AI

    What does an AWS Glue DataBrew profile job produce?

    Show the answer

    Correct answerD. A report of dataset statistics and quality

    AWhy not this: Balancing classes changes the training distribution; profiling describes the existing data.

    BWhy not this: Human-reviewed labels come from annotation workflows, not dataset profiling.

    CWhy not this: Replacing missing values changes data and requires a transformation rather than a profile job.

    DWhy this is right: Profile jobs report statistics such as value distributions, missing values, and duplicate information.

    A DataBrew profile job examines data and produces statistics that help assess its quality. Replacing missing values is a transformation, not the purpose of a profile job.

    Open this question
  5. Question 5

    Data Preparation for ML and AI

    A lender's training data contains only online applicants, but deployment will also cover branch applicants with different income and age distributions. Labels are balanced and fields are complete; which action BEST addresses the source of bias?

    Show the answer

    Correct answerD. Collect labeled records from branch applicants.

    AWhy not this: Outcome classes are already balanced; class resampling does not correct missing population coverage.

    BWhy not this: Shuffling cannot represent branch applicants when the dataset contains only online applicants.

    CWhy not this: The fields are complete, and replacing incomes cannot supply actual branch-applicant examples.

    DWhy this is right: Branch-applicant records add the population missing from the training sample.

    Collecting branch-applicant records addresses selection bias caused by excluding part of the deployment population. Shuffling changes record order but cannot introduce the missing population.

    Open this question
  6. Question 6

    Data Preparation for ML and AI

    A team uses Amazon SageMaker Ground Truth to label confidential clinical notes that cannot leave its approved workforce. Annotators interpret abbreviations inconsistently, and disputed cases require clinical judgment; which actions meet these constraints? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersB. Document abbreviation rules with clinician-approved examples.C. Route disputed annotations to approved clinical experts.D. Use a private workforce containing only approved annotators.

    AWhy not this: Model predictions do not supply the required expert judgment for uncertain annotations.

    BWhy this is right: Clinician-approved rules and examples reduce inconsistent interpretations of abbreviations.

    CWhy this is right: Approved clinical experts supply the judgment required to resolve disputed cases.

    DWhy this is right: A private workforce restricts annotation access to the approved workers.

    EWhy not this: The most frequent label can reflect a shared misunderstanding and does not provide clinical adjudication.

    An approved private workforce controls access, explicit instructions standardize interpretation, and clinical adjudication resolves ambiguity. Majority voting can consolidate judgments but does not provide the required clinical review.

    Open this question
  7. Question 7

    Data Preparation for ML and AI

    An image classifier trained mostly on bright images performs poorly on dim images. Brightness changes preserve the target labels; which training-data change BEST mitigates this lighting bias?

    Show the answer

    Correct answerC. Add label-preserving brightness variations.

    AWhy not this: Oversampling the most frequent class addresses neither lighting coverage nor the stated performance gap.

    BWhy not this: Shuffling changes presentation order without increasing lighting diversity.

    CWhy this is right: Brightness augmentation supplies valid examples under a wider range of lighting conditions.

    DWhy not this: Removing dim images further reduces representation of the conditions where the model performs poorly.

    Label-preserving brightness augmentation expands the lighting conditions represented during training. Shuffling changes example order but does not add underrepresented lighting conditions.

    Open this question
  8. Question 8

    Data Preparation for ML and AI

    A team enables automated data labeling in an Amazon SageMaker Ground Truth job to reduce manual work. How should examples that fail the model's labeling confidence threshold be handled?

    Show the answer

    Correct answerD. Send them to human workers for labeling.

    AWhy not this: A highest-scoring prediction can still have insufficient confidence for automatic acceptance.

    BWhy not this: Discarding uncertain examples can remove difficult but valuable training cases.

    CWhy not this: The most common class is not evidence of the correct label for an individual example.

    DWhy this is right: Human workers label examples that do not meet the confidence requirement for automatic labeling.

    Ground Truth uses human workers for examples that cannot be confidently labeled automatically. Accepting the highest-scoring prediction still risks incorrect labels when its confidence is insufficient.

    Open this question
  9. Question 9

    Data Preparation for ML and AI

    Which Amazon SageMaker Ground Truth task lets workers draw rectangles around individual vehicles in images?

    Show the answer

    Correct answerA. Bounding box

    AWhy this is right: Bounding boxes enclose individual objects with rectangles.

    BWhy not this: Image classification labels an image rather than marking the location of each vehicle.

    CWhy not this: Named entity recognition labels entity spans in text, not objects in images.

    DWhy not this: Semantic segmentation assigns classes to pixels rather than drawing object rectangles.

    Bounding boxes mark the rectangular extent of each object instance. Image classification assigns labels to an image without locating individual vehicles.

    Open this question
  10. Question 10

    Data Preparation for ML and AI

    Separate numeric, text, and image classifiers each have only 2% positive examples. The team will oversample positives by duplicating them. Which order of steps avoids leakage and keeps the evaluation data realistic?

    Show the answer

    Correct answerB. Split the data first, then oversample positives in the training set only

    AWhy not this: Duplicates made before the split can land in both sets, leaking training examples into evaluation.

    BWhy this is right: Training gets more positive examples while the evaluation set stays unseen and keeps its real class distribution.

    CWhy not this: Oversampling the evaluation set changes its class distribution and repeats examples within it, so scores no longer reflect real data.

    DWhy not this: Undersampling the evaluation set changes its class distribution and does nothing for the scarce positives in training.

    Splitting first keeps every copy of a positive example on the training side, so the evaluation set holds no duplicates of training rows and keeps the real 2% positive rate. Oversampling before the split can put copies of one example in both sets, which inflates evaluation scores.

    Open this question
  11. Question 11

    Data Preparation for ML and AI

    Records are sorted by region and have no temporal dependencies. The pipeline assigns the first 80% of rows to training and the rest to testing. Which action reduces regional sampling bias before the split?

    Show the answer

    Correct answerB. Shuffle the records

    AWhy not this: Standardization changes feature scales without changing record order.

    BWhy this is right: Shuffling mixes regions before the ordered 80/20 cut, so both partitions contain every region.

    CWhy not this: Imputation addresses missing values, not regional ordering.

    DWhy not this: Deduplication removes repeated records but does not mix records sorted by region.

    Because the pipeline takes the first 80% of rows for training, region-sorted records would leave some regions only in the test set. Shuffling first mixes regions across both partitions; standardization changes numeric scales but not row order.

    Open this question
  12. Question 12

    Data Preparation for ML and AI

    An engineer prepares numeric, text, and image datasets for Amazon SageMaker Clarify using demographic facets and binary labels. Which pretraining metric directly measures the difference in favorable-label proportions between demographic groups?

    Show the answer

    Correct answerA. Difference in proportions of labels (DPL)

    AWhy this is right: DPL directly compares the proportions of favorable labels between facets.

    BWhy not this: JS measures symmetric distributional divergence, not a signed label-rate difference.

    CWhy not this: KL measures distributional divergence, not the signed difference in favorable-label proportions.

    DWhy not this: Class imbalance compares facet sizes rather than favorable-label proportions.

    DPL measures the difference in positive-label proportions between facets. Class imbalance measures differences in facet representation, not differences in favorable-label rates.

    Open this question
  13. Question 13

    Data Preparation for ML and AI

    A dataset contains numeric, text, and image assets with comparable favorable labels. Demographic label-rate gaps are +0.30 for numeric assets, −0.30 for text assets, and zero for images, but the pooled gap is zero; which assessment should guide rebalancing?

    Show the answer

    Correct answerC. Measure label-rate gaps separately within each modality

    AWhy not this: Pooling conceals the opposing disparities in numeric and text assets.

    BWhy not this: Equal demographic counts can coexist with different favorable-label rates.

    CWhy this is right: Separate measurements preserve the direction and size of disparities hidden by aggregation.

    DWhy not this: Missing-value rates measure completeness rather than favorable-label disparities.

    Modality-specific label-rate gaps reveal disparities that cancel when pooled. Equal overall demographic counts would establish representation balance, not equal favorable-label rates within each modality.

    Open this question
  14. Question 14

    Data Preparation for ML and AI

    Each training example links numeric attributes, text, and an image; age and region individually match deployment proportions, but older rural people are severely underrepresented. All age-region combinations occur, and the engineer must preserve linked assets without collecting data; which approach BEST addresses the gap?

    Show the answer

    Correct answerC. Compare joint age-region frequencies with deployment and weight complete examples

    AWhy not this: Age proportions already match deployment and conceal the age-region intersection deficit.

    BWhy not this: Independent asset resampling can break the relationships among linked numeric, text, and image data.

    CWhy this is right: Joint frequencies reveal the missing representation, while example-level weighting preserves linked assets.

    DWhy not this: Changing labels does not correct the joint representation gap and can corrupt valid ground truth.

    Joint age-region comparisons expose intersectional underrepresentation, and weighting complete examples preserves multimodal alignment. Marginal age checks miss the deficit because individual demographic distributions already match deployment.

    Open this question
  15. Question 15

    Data Preparation for ML and AI

    A text classifier rarely predicts the minority class. The team must retain every training example and cannot generate additional examples; which training change BEST addresses the imbalance?

    Show the answer

    Correct answerC. Increase the penalty for minority-class errors.

    AWhy not this: Equal weights leave the majority class with more aggregate influence because it has more examples.

    BWhy not this: Shuffling can improve training order but does not change class frequencies or class-specific error penalties.

    CWhy this is right: A larger minority-class loss weight makes its errors more influential without changing the training records.

    DWhy not this: Longer input sequences retain more text but do not directly address unequal class representation.

    Class weighting increases the minority class's contribution to the training loss without removing or generating examples. Shuffling changes presentation order but does not counter the majority class's larger contribution.

    Open this question
  16. Question 16

    Data Preparation for ML and AI

    Which technique reduces class imbalance by removing examples from the majority class?

    Show the answer

    Correct answerD. Random undersampling

    AWhy not this: Normalization changes feature scales, not the number of examples in each class.

    BWhy not this: Imputation fills missing values without directly changing class proportions.

    CWhy not this: Shuffling changes record order without changing class counts.

    DWhy this is right: Removing majority-class examples reduces their numerical dominance in the training data.

    Random undersampling reduces the majority class's representation by removing some of its examples. Random shuffling changes record order but leaves class proportions unchanged.

    Open this question
  17. Question 17

    Data Preparation for ML and AI

    Which check verifies that a supervised fine-tuning response actually answers its associated prompt?

    Show the answer

    Correct answerD. Prompt-response relevance review

    AWhy not this: Duplicate detection finds repeated records rather than mismatched prompt-response content.

    BWhy not this: Required-field checks detect absent values, not semantic mismatches between populated fields.

    CWhy not this: Response lengths can reveal anomalies but do not establish whether a response answers its prompt.

    DWhy this is right: Semantic review determines whether the response addresses the request in its associated prompt.

    Prompt-response relevance review checks whether the response addresses the associated request. Completeness checks can confirm that both fields exist, but cannot establish that their contents belong together.

    Open this question
  18. Question 18

    Data Preparation for ML and AI

    A safety fine-tuning dataset intentionally pairs harmful requests with safe refusals. A keyword filter flags many requests; which validation approach BEST preserves useful safety examples while preventing unsafe target responses?

    Show the answer

    Correct answerC. Assess each pair in context and retain policy-compliant refusals.

    AWhy not this: Removing words can change the request's meaning and break its alignment with the response.

    BWhy not this: Harmful wording in a request can be intentional and necessary for teaching an appropriate refusal.

    CWhy this is right: Contextual review can retain legitimate refusal training pairs while excluding unsafe target responses.

    DWhy not this: A response can include a refusal phrase and still provide unsafe content afterward.

    Contextual, policy-based review distinguishes harmful requests paired with safe refusals from unsafe target responses. Blanket keyword removal loses useful refusal examples, while refusal phrases alone do not establish that the rest of a response is safe.

    Open this question
  19. Question 19

    Data Preparation for ML and AI

    Separate numeric, text, and image training sets have rare target classes; validation sets already reflect production prevalence. Which changes address training imbalance without contaminating validation? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersC. Add minority-text paraphrases after verifying their labels.D. Create synthetic minority examples from numeric training neighbors.E. Add label-preserving transformations of minority training images.

    AWhy not this: Standardization and tokenization change representations but do not correct unequal class frequencies.

    BWhy not this: Repartitioning duplicated examples can put the same example into training and validation, causing leakage.

    CWhy this is right: Verified paraphrases add minority text examples while preserving the intended class.

    DWhy this is right: Generating minority examples using only training data increases representation without using validation information.

    EWhy this is right: Label-preserving image transformations increase minority training examples without altering validation data.

    Training-only numeric synthesis and label-verified text and image augmentation increase minority representation while preserving independent validation sets. Duplicating before repartitioning can place copies in both training and validation, causing leakage.

    Open this question
  20. Question 20

    Data Preparation for ML and AI

    A dataset is partitioned into training and validation sets, both containing missing numeric values. The engineer must impute them while keeping validation independent; which approach should the engineer use?

    Show the answer

    Correct answerD. Fit imputation on training data; apply it to both sets

    AWhy not this: Combined fitting lets validation values influence the replacements used during training.

    BWhy not this: Validation-only fitting directly uses evaluation information to determine training replacements.

    CWhy not this: Independent validation fitting uses evaluation data to learn replacements instead of evaluating the training-fitted pipeline.

    DWhy this is right: Training-only fitting prevents validation information from influencing learned replacements and applies consistent preprocessing.

    Learn imputation statistics from training data and reuse them unchanged for validation. Fitting separately on validation data lets the evaluation distribution influence preprocessing and does not reproduce the training-fitted transformation.

    Open this question
  21. Question 21

    Data Preparation for ML and AI

    A temperature feature combines readings in Celsius and Fahrenheit, with each record's unit stored in metadata. Which cleaning action makes the values comparable without discarding valid measurements?

    Show the answer

    Correct answerC. Convert readings to one unit using metadata

    AWhy not this: Z-score standardization of mixed units preserves the underlying unit inconsistency.

    BWhy not this: A combined median cannot distinguish unit differences from genuine high temperatures.

    CWhy this is right: Metadata-guided conversion preserves each measured temperature while expressing all readings in a common unit.

    DWhy not this: Group-mean replacement discards valid variation instead of correcting measurement units.

    Unit conversion uses the metadata to express every reading on the same physical scale. Standardizing the mixed values does not correct their incompatible meanings; equal numeric values can represent different temperatures.

    Open this question
  22. Question 22

    Data Preparation for ML and AI

    A customer dataset has missing annual-income values and a strongly right-skewed distribution with valid extreme incomes. Which replacement best preserves a typical income without being strongly influenced by those extremes?

    Show the answer

    Correct answerB. The median observed income

    AWhy not this: Zero asserts an income value that missingness does not establish and can distort the distribution.

    BWhy this is right: The median represents the distribution's midpoint and is resistant to extreme values.

    CWhy not this: Using the maximum replaces missing values with an extreme rather than a typical income.

    DWhy not this: The mean is pulled upward by the high-income tail of a right-skewed distribution.

    Median imputation provides a central value that is resistant to extreme incomes. Mean imputation is more sensitive to the high-income tail and can produce replacements above the typical income.

    Open this question
  23. Question 23

    Data Preparation for ML and AI

    Repeated ingestion has created identical copies of transaction records. Which cleaning operation removes the extra copies?

    Show the answer

    Correct answerA. Deduplication

    AWhy this is right: Deduplication identifies repeated records and retains the required unique records.

    BWhy not this: Imputation supplies replacements for missing values rather than removing copies.

    CWhy not this: Standardization rescales numeric features rather than removing repeated records.

    DWhy not this: Shuffling changes record order without removing repeated records.

    Deduplication removes redundant copies of records. Shuffling changes record order but leaves the duplicate records in the dataset.

    Open this question
  24. Question 24

    Data Preparation for ML and AI

    A fine-tuning dataset contains safe, well-formed responses, but a join error may have attached responses to unrelated prompts. Which validation should the engineer prioritize?

    Show the answer

    Correct answerA. Check prompt-response semantic alignment

    AWhy this is right: Semantic alignment validation checks whether each response meaningfully answers its paired prompt.

    BWhy not this: Content safety screening detects prohibited material, not mismatched associations between otherwise safe prompts and responses.

    CWhy not this: Completeness checks find absent fields; incorrectly paired records can have every required field populated.

    DWhy not this: Demographic proportions reveal representation differences, not incorrect prompt-response associations.

    Prompt-response semantic alignment checks whether each response addresses its associated prompt. Content safety screening can identify prohibited material but cannot establish that a safe response answers the correct prompt.

    Open this question