学习笔记之Confusion Matrix

Confusion matrix - Wikipedia

  • https://en.wikipedia.org/wiki/Confusion_matrix
  • In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix,[4] is a specific table layout that allows visualization of the performance of an algorithm, typically a supervised learning one (in unsupervised learning it is usually called a matching matrix). Each row of the matrix represents the instances in a predicted class while each column represents the instances in an actual class (or vice versa).[2] The name stems from the fact that it makes it easy to see if the system is confusing two classes (i.e. commonly mislabeling one as another).
  • It is a special kind of contingency table, with two dimensions ("actual" and "predicted"), and identical sets of "classes" in both dimensions (each combination of dimension and class is a variable in the contingency table).
  • condition positive (P) the number of real positive cases in the data
  • condition negative (N) the number of real negative cases in the data
  • true positive (TP) eqv. with hit
  • true negative (TN) eqv. with correct rejection
  • false positive (FP) eqv. with false alarmType I error
  • false negative (FN) eqv. with miss, Type II error
  • sensitivityrecallhit rate, or true positive rate (TPR)
    • {\displaystyle \mathrm {TPR} ={\frac {\mathrm {TP} }{P}}={\frac {\mathrm {TP} }{\mathrm {TP} +\mathrm {FN} }}=1-\mathrm {FNR} }
  • specificityselectivity or true negative rate (TNR)
    • {\displaystyle \mathrm {TNR} ={\frac {\mathrm {TN} }{N}}={\frac {\mathrm {TN} }{\mathrm {TN} +\mathrm {FP} }}=1-\mathrm {FPR} }

Sensitivity and specificity - Wikipedia

  • https://en.wikipedia.org/wiki/Sensitivity_and_specificity
  • Sensitivity and specificity are statistical measures of the performance of a binary classificationtest, also known in statistics as a classification function:
    • Sensitivity (also called the true positive rate, the recall, or probability of detection[1] in some fields) measures the proportion of actual positives that are correctly identified as such (e.g., the percentage of sick people who are correctly identified as having the condition).
    • Specificity (also called the true negative rate) measures the proportion of actual negatives that are correctly identified as such (e.g., the percentage of healthy people who are correctly identified as not having the condition).
  • In general, Positive = identified and negative = rejected. Therefore:
    • True positive = correctly identified
    • False positive = incorrectly identified
    • True negative = correctly rejected
    • False negative = incorrectly rejected

sklearn.metrics.confusion_matrix — scikit-learn 0.20.2 documentation

  • https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html
  • sklearn.metrics.confusion_matrix(y_true, y_pred, labels=None, sample_weight=None)
  • Compute confusion matrix to evaluate the accuracy of a classification

Machine Learning with Python: Confusion Matrix in Machine Learning with Python

  • https://www.python-course.eu/confusion_matrix.php

精确率与召回率,RoC曲线与PR曲线 - 刘建平Pinard - 博客园

  • https://www.cnblogs.com/pinard/p/5993450.html

猜你喜欢

转载自www.cnblogs.com/pegasus923/p/10469919.html