Using Keras for R, I am working with an imbalanced binary class data set for classification, with ~90% negative examples and ~10% positive examples and a batch size of 20 when training.
I am interested in ensuring, that each batch used for back-propagating is balanced, such that ~10 data points are sampled from the positive training data and ~10 from the negative. Thereby avoiding that the model is biased towards negative data.
I have been unable to find RStudio/Keras documentation on how to do this? (There is class_weight for fit(), but I am uncertain if this would achieve my objective)
Thanks in advance!