Class-balanced loss weights each class's contribution to training so models focus more on minority-class patterns when data are imbalanced. A common choice uses the inverse class distribution: wi = N/Ni, where N is the total training count and Ni is class i's count. section 5.2.2
Practical choices include:
- Use inverse-frequency weights when minority examples should receive greater influence. section 5.2.2
- Derive weights from domain expertise, hyperparameter tuning, or established best practices instead of using inverse frequencies. section 5.2.2
- Compare weighting with oversampling and undersampling, then evaluate using validation PR AUC rather than training performance alone. section 5.2.2
Virtual screening for inhibitors
In a virtual screening pipeline, missing an inhibitor can waste downstream drug-discovery resources. A class-weighted decision tree achieved validation PR AUC 0.736, while a default logistic regressor reached 0.813; training PR AUC of 1 for the trees indicated overfitting. section 5.2.2
The equation makes the inverse-frequency weighting rule explicit. section 5.2.2
