Hey, I am making a multi-class classifier with 4 classes. Now I have printed Sensitivity and Specificity along with a confusion matrix. Now I want to print the ROC plot of 4 class in the curve. As ROC is binary metric, so it is ‘given class vs rest’, but I want to add all 4 classes in the same plot.
With this code, I have got my probability -
output = model.forward(images)
p = torch.nn.functional.softmax(output, dim=1)
Can you guys please help me to get this Multi class ROC graph? Thanks.
fpr and tpr are False Positive Rate and True Positive Rate respectively while your metrics are different FP and TP. You will get FPR and TPR from roc_curve() function.
y_test refers to the True Predictions i.e Ground Truth(y_true) and y_score are predictions generated by your model (y_pred).