Difference between revisions of "Confusion Matrix"
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))...") |
|||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Decode the sklearn confusion matrix: | Decode the sklearn confusion matrix: | ||
| − | <syntaxhighlight lang=python> | + | |
| + | (This page is just a test of syntax highlighting.) | ||
| + | <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)) | ||
| Line 8: | Line 10: | ||
print('F1-score:', tp/(tp+(fn+fp)/2)) | print('F1-score:', tp/(tp+(fn+fp)/2)) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | ===Confusion Matrix (and other stuff) Resources=== | ||
| + | * [https://lucdemortier.github.io/articles/16/PerformanceMetrics Performance metrics] by some physicist | ||
| + | * [https://nikolh92.medium.com/confidence-intervals-in-hypothesis-testing-3dd573287d0e Confidence intevals] in Python (medium.com) | ||
| + | * [https://www.reneshbedre.com/blog/ttest.html 3 types of t-test] in Python (scipy) | ||
| + | * [https://towardsdatascience.com/confidence-intervals-with-python-bfa28ebb81c CIs in Python] (and a bunch of other stuff; scipy-based) | ||
| + | * [https://lucdemortier.github.io/articles/16/PerformanceMetrics More on confusion metrics and matrices] | ||
Latest revision as of 00:24, 26 August 2024
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[edit]
- Performance metrics by some physicist
- Confidence intevals in Python (medium.com)
- 3 types of t-test in Python (scipy)
- CIs in Python (and a bunch of other stuff; scipy-based)
- More on confusion metrics and matrices