What is the/an accepted way to deal with imbalanced data in fastai2? I found this callback but it doesn’t seem to have an explanation how it should work or how I would apply it to my data nor are the arguments documented. I’m working with image data that is loaded into the datablock:
datasets = DataBlock(blocks = (ImageBlock, CategoryBlock), get_items=get_image_files, splitter=RandomSplitter(seed=42), get_y=label_func, item_tfms=Resize(460), batch_tfms=aug_transforms(size=224, min_scale=0.75)) dls = datasets.dataloaders(path)
and my learner is:
learn = cnn_learner(dls, resnet34, metrics=accuracy) learn.fine_tune(5)
The two categories are highly imbalanced and I was looking for a straightforward way to deal with that.