Class imbalance occurs when labeled classes have substantially unequal representation. Models may favor the majority class and underperform on the minority class. section 6.3.4
Overall accuracy can hide this problem. Evaluate predictions separately by class with a confusion matrix and class-specific accuracy rates. section 6.3.4 section 6.4.3
Unequal performance across conversion outcomes
A decision tree predicting successful and unsuccessful fourth-down conversions achieved 51% accuracy when the true label was 0 but 72% when it was 1. The disparity may reflect imbalanced data or different feature patterns. section 6.3.4
>>> from sklearn.metrics import confusion_matrix, >>> conf_matrix = confusion_matrix(y_test, y_pred) >>> print(conf_matrix) [[71 67] [36 91]]
Inspect the confusion matrix before relying on overall accuracy; its cells support separate evaluation of each class. section 6.3.4










