Ensuring all classes in validation set is represented in training class

In implementing a classifier, what is the best way to account for sparsely populated classes (so that all classes in validation set is represented in the training set)?
DataLoaders don’t seem to ensure this. Can you give me tips on how best to add this functionality? Thank you.

1 Like