AWS Certified Machine Learning Engineer - Associate (MLA-C02) free question 2 / 10 · Domain 1: Data Preparation for ML and AI
A fraud dataset for binary classification has fraud cases in only a small share of the rows. A data scientist wants Data Wrangler to create new synthetic fraud samples from the existing ones, rather than copy rows or discard legitimate rows. Which Balance data operator should be used?
- Random oversampling, which adds synthetic rows built from neighboring fraud cases
- Random undersampling, which builds fraud rows by averaging two legitimate rows
- SMOTE, which interpolates new synthetic rows from samples of the underrepresented category
- The Stratified sampling method of the Sampling transform, which generates minority rows
Show the answer and explanation
Answer: C
Why this is correct
The Balance data operation offers three operators for datasets with an underrepresented category. Random oversampling duplicates minority samples, random undersampling removes samples from the overrepresented category, and SMOTE uses samples from the underrepresented category to interpolate new synthetic minority samples. Creating synthetic fraud rows without copying or discarding data is the SMOTE behavior.
Why the other options are wrong
"Random oversampling, which adds synthetic rows built from neighboring fraud cases" … Random oversampling randomly duplicates samples in the minority category. It produces copies of existing fraud rows, not new interpolated samples.
"Random undersampling, which builds fraud rows by averaging two legitimate rows" … Random undersampling removes samples from the overrepresented category to reach the desired proportion. It discards legitimate rows and creates no synthetic rows.
"The Stratified sampling method of the Sampling transform, which generates minority rows" … The Sampling transform takes samples of an existing dataset, and a stratified sample represents the original distribution. It does not generate new rows or rebalance the classes.
Key points
Balance data helps binary classification models, and it cannot be used on datasets that contain column vectors. SMOTE works on a dataset with numeric and non-numeric features. The page notes that Balance data cannot be used on datasets that contain column vectors. In its example fraud occurs in only 10% of the data, so random oversampling duplicates the fraud cases 8 times to reach equal proportions.