Created
October 22, 2021 21:40
-
-
Save rohan-paul/5b869aebce7ae05fb7580eee0a82ce50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Now generate TPR, FPR and ROC data | |
tpr,fpr,roc_auc = ([[]]*number_of_classes for _ in range(3)) | |
f,ax = plt.subplots() | |
for i in range(number_of_classes): | |
fpr[i], tpr[i], _ = roc_curve(labels==i, predictions[:, i]) | |
roc_auc[i] = auc(fpr[i], tpr[i]) | |
ax.plot(fpr[i],tpr[i]) | |
plt.legend(['Class {:d}'.format(d) for d in range(number_of_classes)]) | |
plt.xlabel('FPR') | |
plt.ylabel('TPR') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment