Issue while using Auc metric on imbalanced dataset like melanoma(ValueError: Only one class present in y_true. ROC AUC score is not defined in that case)
IamSantoshKumar opened this issue · 2 comments
IamSantoshKumar commented
this problem occur due to running metric calculation
I got the solution from stackoverflow:
You cannot have an ROC curve without both positive and negative examples in your dataset. With only one class in the dataset, you cannot measure your false-positive rate, and therefore cannot plot an ROC curve. This is why you get this error message.
How to handle this problem?
abhishekkrthakur commented
you need to handle it manually. if all match, return 1 else return 0.5
IamSantoshKumar commented
Fixed, thanks for the input @abhishekkrthakur