pu-learning
pu-learning copied to clipboard
Struggling with predicted class in binary classification
Hi, I'm doing some research using nnPU with binary classification.
During my experiments, there is a problem that train loss & validation loss are decreasing just like the way loss decreases in the paper of nnPU, but printed confusion matrix every 5 epochs are odd (scoring extremely low metrics suchs as precison, recall, f1-score etc)
I'm expecting the reason of this problem is accurred when each batch output of the model are mapped to the predicted class wrong because all same settings but different loss with cross entropy learns the data very well.
I'm mapping the output of the model to the calss by pred = torch.where(out[:batch_size] < 0, torch.tensor(-1), torch.tensor(1))
, which seems nothing wrong about the code. Is there any opinion or information to deal with this situation?