PROFESSIONAL-MACHINE-LEARNING-ENGINEER practice question 18 of 35

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?

Full set: 283 questions
Answer options
A: Write your data in TFRecords.
B: Z-normalize all the numeric features.
C: Oversample the fraudulent transaction 10 times. Correct answer
D: Use one-hot encoding on all categorical features.
Correct Answer:
C. Oversample the fraudulent transaction 10 times.
Explanation

The primary challenge described is severe class imbalance, with the minority class (fraudulent transactions) representing only 1% of the data. Standard classifiers, including Random Forests, can become biased towards the majority class, leading to poor performance in identifying the rare, but critical, fraudulent cases. Oversampling the minority class is a common and effective strategy to mitigate this issue. By increasing the representation of fraudulent transactions in the training set, the model is better able to learn their distinguishing features, which typically improves key performance metrics like recall and F1-score for the minority class.

Why Incorrect

A. Write your data in TFRecords. TFRecord is a data storage format that optimizes data I/O performance, especially in TensorFlow pipelines. It does not address the underlying statistical problem of class imbalance.
B. Z-normalize all the numeric features. Tree-based models like Random Forests are not sensitive to the scale of features because their splitting criteria are based on ordering and thresholds, not magnitude. Therefore, normalization offers negligible benefit.
D. Use one-hot encoding on all categorical features. While one-hot encoding is a standard and necessary preprocessing step for using categorical features in many models, it is a general practice and does not specifically address the performance issue caused by class imbalance.

References

1. Google Cloud Documentation: In the official documentation for BigQuery ML, when discussing imbalanced data, it is stated that "If the number of rows for the minority class is less than 500, you should use oversampling to increase the number of rows for the minority class to 500." This directly supports oversampling as a recommended strategy for imbalanced classification.

Source: Google Cloud, "Handle imbalanced data in BigQuery ML".

Section: "Use the datasplitcol option with oversampling".

2. University Courseware: Stanford's CS 230 Deep Learning course materials discuss handling imbalanced datasets as a key challenge. They list "Oversampling" (including techniques like SMOTE) as a primary method to rebalance the dataset, which involves adding copies of the minority class or synthesizing new examples.

Source: Stanford University, CS 230: Deep Learning, Autumn 2018.

Section: "Tips for training, Class Imbalance".

3. Academic Publication: The foundational paper on the Synthetic Minority Over-sampling Technique (SMOTE) explains the problem of imbalance in detail. The authors state, "The problem of learning from imbalanced datasets is a recent challenge... One of the proposed solutions is to over-sample the minority class." This establishes oversampling as a core academic approach.

Source: Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002). SMOTE: synthetic minority over-sampling technique. Journal of artificial intelligence research, 16, 321-357.

DOI: https://doi.org/10.1613/jair.953 (Section 1: Introduction, Paragraph 2).

Scroll to Top