Class imbalance occurs when classes appear in uneven proportions. A model can then favor the majority label, producing high accuracy while failing to detect the minority class. section 4.2.1
Why accuracy can mislead
For cancer prediction, a dataset with 99.9% “no cancer” cases permits 99.9% accuracy by always predicting “no cancer,” yet the model is not useful. In a 99% A and 1% B dataset, random splitting might produce 99.5% A and 0.5% B. section 4.2.1
Stratified sampling preserves the original class ratios in train/test splits. It provides a simple improvement for the name-language dataset, while broader imbalance treatments remain outside scope. section 4.2.1










