Hello, everyone!
I would like to understand which of the 2 options is a better approach to deal with an imbalanced dataset.
I’m dealing with a dataset that has:

516 items in class 0
91 items in class 1
622 items in class 2
592 items in class 3

My data has way less items of class 1 in  comparation to the other classes.
Searching a little i found that the usual approach to this kind of problem is:

Use torch.optim.WeightedRandomSampler() where i sample with probability (weights)
Use torch.nn.CrossEntropyLoss(weights) (my problem is classification) where i weight each class for the update part

I couldn’t find an answer to which one of them is a better approach in which cases, and i would be very thankful if someone could explain to me, even if it doesn’t actually metter which one to choose.