Imagine that you simply’ve trained a predictive model with an accuracy rating as high as 0.9. The evaluation metrics like precision, recall and f1-score also appear promising. But your experience and intuition told you that something isn’t right so you probably did further investigation and located this:
The model’s seemingly strong performance is driven by the bulk class 0
in its goal variable. Because of the evident imbalance between the bulk and minority classes, the model excels at predicting its majority class 0
while the performance of the minority class 1
is way from satisfactory. Nonetheless, because class 1
represents a really small portion of the goal variable, its performance has little impact on the general scores of those evaluation metrics, which supplies you an illusion that the model is robust.
This shouldn’t be a rare case. Quite the opposite, data scientists steadily come across imbalanced datasets within the real-world projects. An imbalanced dataset refers to a dataset where the classes or categories will not be…