NCA-ADS - Data Manipulation and Preparation - Section 1.5

Handle class imbalance.

Describe techniques for addressing class imbalance, including oversampling, undersampling, and class-weight adjustment. Choose the most appropriate strategy given the dataset size, the cost of false positives versus false negatives, and the chosen classifier.

Practice question for this objective

Free sampleData Manipulation and Preparationmedium

A fraud classifier on a dataset with only 2 per cent positives reports a high ROC-AUC of 0.93, yet stakeholders complain that most transactions it flags turn out to be legitimate. The team wants an evaluation curve that reflects how the trade-off between catching fraud and raising false alarms behaves under this severe imbalance. Which curve is the most informative choice?

  • AA precision-recall curve, because under heavy imbalance it directly exposes how precision falls as recall rises, a pattern that ROC-AUC can mask. Correct
  • BA calibration curve plotting predicted probability against observed frequency to check whether the scores are well calibrated.
  • CA learning curve plotting training and validation error against the number of training samples to diagnose under- or over-fitting.
  • DA residual plot of prediction errors against fitted values to check for systematic bias across the prediction range.
Under severe class imbalance, use the precision-recall curve rather than ROC-AUC to evaluate the trade-off between recall and false alarms. ROC-AUC can remain high under heavy imbalance because the large negative count keeps the false-positive rate low even when many flagged cases are wrong; the precision-recall curve instead shows precision collapsing as recall rises, giving a faithful picture of false-alarm cost.

Why A is correct: Correct. The precision-recall curve plots precision against recall across thresholds, so it directly reveals the high false-alarm rate at a given recall. Under severe imbalance ROC-AUC can stay high while precision is poor, which is exactly the stakeholders' complaint.

Why B is wrong: A calibration curve assesses probability reliability, not the precision-versus-recall trade-off the stakeholders care about. It is tempting because calibration is a valid diagnostic, but it does not show how flagging more fraud affects false alarms, so it is wrong.

Why C is wrong: A learning curve diagnoses bias and variance with respect to dataset size, not the threshold trade-off between precision and recall. It is tempting because it is a standard evaluation plot, but it does not address imbalance scoring, so it is wrong.

Why D is wrong: Residual plots are a regression diagnostic for continuous targets, not a classification imbalance tool. It is tempting because it sounds like an evaluation chart, but it does not apply to a fraud classifier's precision-recall behaviour, so it is wrong.

See more NCA-ADS practice questions, answers explained.

More in this domain

Back to all Data Manipulation and Preparation objectives, or the NCA-ADS cert hub.

Examworthy is not affiliated with or endorsed by NVIDIA. Original, blueprint-aligned practice material only.