Optimization-AI / LibAUC

LibAUC: A Deep Learning Library for X-Risk Optimization
https://libauc.org/
MIT License
273 stars 37 forks source link

pos_num in ImbalanceSampler #12

Closed berkuva closed 2 years ago

berkuva commented 2 years ago

What is ImbalanceSampler's parameter pos_num supposed to mean? If we have a binary classification, is it the positive label? For example, with cancer and no cancer task, 0 means no cancer, and 1 is cancer, then pos_num is 1? Thanks!

yzhuoning commented 2 years ago

pos_num refers to the number of samples from positive class in a mini-batch. For instance, you set pos_num=10, meaning that there will be 10 examples randomly sampled from positive class in each mini-batch. In our default setting, we denote positive class (minority class) as 1 and negative class (majority class) as 0.

I am working on a tutorial to demonstrate how to use ImbalanceSampler, and it will be released soon. If you find our library useful, please help star the repo! Thanks!