Only 1% of transactions are fraud. What is one way to handle this during preparation?
Why A is the answer
Resample the classes or use class weights
Imbalance needs resampling or weighting. Accuracy alone would look high and mean little.
In detail
- Resampling or class weights make rare cases count.
- Evaluate with precision and recall, not accuracy.
Use case
An illustrative scenario, not a real incident.
Only 1% of transactions are fraud, so a model that says "never fraud" scores 99% accuracy. Class weights make it care about the rare class.
See it in different ways
mindmap
root((Data preparation))
Missing values
Impute
Categories
One-hot encoding
Ranges
Scaling
Imbalance
Resampling
Class weights
Leakage
Remove future datamindmap
root(("Class imbalance"))
n1["Change the data"]
n2["Resample"]
n3["Change the training"]
n4["Class weights"]Key point: Resample or weight imbalanced classes.
Why the other options are wrong
- B. Remove all of the fraud rows from the training data
- That removes what you need to find.
- C. Report accuracy only and ignore other metrics
- Accuracy misleads on imbalanced data.
- D. Train on a dataset with only the normal class
- With no fraud rows, there is nothing to learn.

