What is Class imbalance?
In Turkish: Sınıf dengesizliği · Topic: Data and evaluation
A situation where one class in a dataset has far fewer examples than the others, making it hard for a model to learn that rare class.
How does it work?
In fraud detection, the vast majority of transactions are legitimate and only a tiny share are fraudulent. During training, most of the error comes from the majority class, so the rare class is easily ignored; even a strategy of “always predict the majority class” can score high accuracy. Remedies include oversampling the minority class, dropping some majority examples, giving classes different weights, or generating synthetic examples. Evaluation also shifts from accuracy to measures such as precision and recall.
Why does it matter?
Many important problems, such as rare diseases, fraud and machine failures, are imbalanced by nature. If the issue goes unnoticed, a model can look successful on paper with high accuracy while missing exactly the cases that matter.
Example
If 99.5 percent of items on a production line are fine, a model that labels everything “fine” gets 99.5 percent accuracy yet catches none of the defective items.
FAQ
Why is accuracy misleading on imbalanced data?
Always predicting the majority class already yields high accuracy, even if the rare class is never detected. That is why precision, recall or AUC are checked too.
What is oversampling?
It means increasing the number of minority-class examples, by copying them or generating new ones, so the model sees the rare class more often.