I am building a binary classification model which has 17K values as class A and 10K values as class B. I want to know when a dataset can face the issues of "IMBALANCED Dataset" ?
2 Answers
In general there will be not a hard rule about this, but this dataset seems to be like balanced. The point about disbalanced is that you have to keep in mind that the accuracy of your model will have a different starting point. For this python has the function to run a baseline with dummy classification. https://scikit-learn.org/stable/modules/generated/sklearn.dummy.DummyClassifier.html. This gives you a good indication what is your baseline (if you choose the the strategy to most_frequent). In your case, any prediction model which always forecast class A, would have a accuracy of: 17/(10+17) = 0,6296... , so any binary classification with a score under this value would be really bad
There is no strict definition about when to call a dataset "imbalanced", but generally speaking it's when the imbalance is likely to cause a problem with the model. Typically the problem is that the model will use the majority class as a default, because assigning the majority class is far less likely to be an error: for example if the data consists of 99% class A and 1% class B, a model which always predicts A will achieve 99% accuracy.
Your case would not be called imbalanced: the minority class makes up a large proportion of the data so it's very unlikely that the model would ignore it.