Class balancing reshapes training data so positive and negative samples appear at roughly equal rates. Without it, a class that is 500 times larger can fill about 14 of every 15 batches with negative examples, repeatedly pushing the model toward predicting only the majority class. section 14.4.1
A balanced training stream works by:
- Reusing scarce positive samples when the dataset contains only a small fixed number of them. section 14.4.1
A balanced training option
A command-line --balanced flag enables ratio-based sampling. The training loader passes ratio_int=int(cli_args.balanced) to LunaDataset; with the flag enabled, the dataset reports a fixed length and alternates positive and negative selection according to the ratio.
