I have an imbalanced multi-class dataset and I want to use the class_weight
argument from fit_generator
to give weights to the classes according to the number of images of each class. I'm using ImageDataGenerator.flow_from_directory
to load the dataset from a directory.
Is it possible to directly infer the class_weight
argument from the ImageDataGenerator
object?