Clear and concise confusion matrix

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

Confusion matrix (Confusion Matrix)

Baidu Encyclopedia:

Confusion matrix is ​​also called error matrix is ​​a standard format accuracy of the evaluation, in the form of a matrix with n rows and n columns is expressed.

After reading the confusion matrix of TN, TP, FN, FP, and the recall rate, precision of expression, a bit confused. The number of sheets with reference to FIG confusion matrix, making an "icon:

Here Insert Picture Description

Note:

  • The comparison of the predicted and the real situation, the sample distribution to all four quadrants of the (present n n When the categories, there is confusion matrix n 2 n^2 quadrants composition);

  • The name of each quadrant, such as the TP, represents TruePositive, True indicates the prediction result is correct, the prediction indicates Positive sample is a positive example, as shown below:
    Here Insert Picture Description

  • Refers to the respective ratios are correctly predicted case ( green shading part), accounting for the row / column .

  • Regardless of several categories confusion matrix, only the diagonal is correct (consistent with the actual predictions, simply referred to as only diagonal green )

recall/precision tradeoff

When the recall and precision should have taken the maximum value, the best performance. But both have a trade-off phenomenon, so the introduction of harmonic mean (harmonic mean) F 1 s c O r e F_1score F 1 = 2 1 p r e c i s i o n + 1 r e c a l l = 2 × p r e c i s i o n × r e c a l l p r e c i s i o n + r e c a l l = T P T P + F N + F P 2 F_1 =\frac{2}{\frac{1}{precision}+\frac{1}{recall}}=2×\frac{precision×recall}{precision+recall}=\frac{TP}{TP+\frac{FN+FP}{2}}
Compared to arithmetic mean, harmonic mean may be a larger weight to a lower value.

Here Insert Picture Description

  • FIG apparent three curves intersect at the same point

Guess you like

Origin blog.csdn.net/houhuipeng/article/details/92405197