nerdexam
Google

PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #31

You work for a bank and are building a random forest model for fraud detection. You have a dataset that includes transactions, of which 1% are identified as fraudulent. Which data transformation…

The correct answer is C. Oversample the fraudulent transaction 10 times. With a highly imbalanced dataset (1% fraud, 99% legitimate), a naive classifier can achieve 99% accuracy by always predicting 'not fraud' - completely useless for detection. Oversampling the minority class (fraudulent transactions) 10× brings the class ratio closer to balance…

Submitted by salim_om· Apr 18, 2026Data processing and feature engineering

Question

You work for a bank and are building a random forest model for fraud detection. You have a dataset that includes transactions, of which 1% are identified as fraudulent. Which data transformation strategy would likely improve the performance of your classifier?

Options

  • AWrite your data in TFRecords.
  • BZ-normalize all the numeric features.
  • COversample the fraudulent transaction 10 times.
  • DUse one-hot encoding on all categorical features.

How the community answered

(41 responses)
  • A
    5% (2)
  • B
    7% (3)
  • C
    71% (29)
  • D
    17% (7)

Explanation

With a highly imbalanced dataset (1% fraud, 99% legitimate), a naive classifier can achieve 99% accuracy by always predicting 'not fraud' - completely useless for detection. Oversampling the minority class (fraudulent transactions) 10× brings the class ratio closer to balance, forcing the model to learn meaningful fraud patterns rather than defaulting to the majority class. This directly addresses the core challenge of class imbalance in fraud detection. Writing data as TFRecords (A) is a storage format change with no impact on model learning. Z-normalization (B) helps with distance-based models but not tree-based random forests, which are scale-invariant. One-hot encoding (D) is standard preprocessing but does not address the imbalance problem.

Topics

#Class Imbalance#Oversampling#Data Transformation#Fraud Detection

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice