Most likely your model is predicting the majority class only, so I guess it’s predicting the
False
class. You can check it by printing the unique predictions for the datasets.
You mean, take the predictions and see their probability distributions?
You could use
nn.BCEWithLogitsLoss
, remove thesigmoid
, and set thepos_weight
asnumber_negative_samples / number_positive_samples
. If that doesn’t work, try to useWeightedRandomSampler
as described here.
I’ll do it and let you know
Also, note that the accuracy can be misleading for an imbalanced dataset as described in the Accuracy paradox.
I’ll ckeck out both links
Thanks @ptrblck, best regards