Difference between revisions of "Confusion Matrix"
Jump to navigation
Jump to search
| Line 1: | Line 1: | ||
Decode the sklearn confusion matrix: | Decode the sklearn confusion matrix: | ||
| + | |||
| + | (This page is just a test of syntax highlighting.) | ||
<syntaxhighlight lang=python> | <syntaxhighlight lang=python> | ||
def deconfuse(tn, fp, fn, tp): | def deconfuse(tn, fp, fn, tp): | ||
Revision as of 01:22, 26 February 2021
Decode the sklearn confusion matrix:
(This page is just a test of syntax highlighting.)
def deconfuse(tn, fp, fn, tp):
print('Precision:', tp/(tp+fp))
print('Recall (TPR):', tp/(tp+fn))
print('Specificity (TNR):', tn/(tn+fp))
print('Accuracy:', (tp+tn)/(tp+tn+fp+fn))
print('F1-score:', tp/(tp+(fn+fp)/2))