Confusion Matrix

From Bitnami MediaWiki
Revision as of 00:24, 26 August 2024 by User (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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))

Confusion Matrix (and other stuff) Resources