Unbalanced classification problem

Hi, I’m working on a binary classification model using GraphSage with a BCEWithLogitsLoss () as loss function. The model is running but it does not perform well and I think it is because of my unbalanced set, only 1% label 1 and the rest is 0. Is there any way to define a weighted loss function? Its not clear to me how to do something like this or what else can I do to address this problem?

Thanks!

If you use PyTorch, PyTorch allows you to do that by setting pos_weight in BCEWithLogitsLoss.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.