I double checked and they are not inverted, the true targets contain 137 ones and 10933 zeros, the predicted targets contain 41 ones and the rest are zeros. that is the reason i’m not getting the random accuracy, my recall and precision are so low. if i use accuracy_score as my metric i do get 98% accuracy but that’s because most of the targets are 0 anyway.
I plotted the loss and accuracy with and without WeightedRandomSampler.
the top two plots show the result without WRS, the bottom two show the result with WRS:
imgonline-com-ua-twotoone-dq71ra5Npmb4bW1356×1130 108 KB