Difference between revisions of "Confusion Matrix"

From Bitnami MediaWiki
Jump to navigation Jump to search
(Created page with "Decode the sklearn confusion matrix: <syntaxhighlight lang=python> def deconfuse(tn, fp, fn, tp): print('Precision:', tp/(tp+fp)) print('Recall (TPR):', tp/(tp+fn))...")
 
Line 1: Line 1:
 
Decode the sklearn confusion matrix:
 
Decode the sklearn confusion matrix:
−
<syntaxhighlight lang=python>  
+
<syntaxhighlight lang=python> def deconfuse(tn, fp, fn, tp):
−
def deconfuse(tn, fp, fn, tp):
 
 
     print('Precision:', tp/(tp+fp))
 
     print('Precision:', tp/(tp+fp))
 
     print('Recall (TPR):', tp/(tp+fn))
 
     print('Recall (TPR):', tp/(tp+fn))

Revision as of 20:51, 13 February 2021

Decode the sklearn confusion matrix:

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