HyperAI

Precision

PrecisionIt is a metric used in information retrieval and statistical classification, which refers to the ratio of the correct samples extracted to the number of samples extracted. A similar concept is recall, which refers to the ratio of the number of samples extracted to the total number of samples.

The difference between the two concepts (accuracy of the confusion matrix)

The four results of binary classification are also called confusion matrix, as shown in the following figure:

True categoryPrediction is positivePrediction is negative
Positive ExampleTP (True Example)FP (False Counterexample)
CounterexampleFN (False Positive)TN (True Counterexample)

Several metrics related to the above results:

Precision P = TP / (TP + FP) The probability that a sample predicted as 1 is actually 1

Recall R = TP / (TP + FN) The probability of predicting a value of 1 in a sample that is actually 1

When both values are between 0 and 1, the closer the value is to 1, the higher the recall or precision.

The connection between the two concepts

Precision and recall are often used to judge the performance indicators of machine learning. There are two main types of precision and recall: P-R curve and F1 metric:

P-R Curve:The curve obtained with precision and recall as the X-axis and Y-axis respectively;

F1 metric:The harmonic mean of precision and recall, defined as 1 / F 1 = 1 / 2 * (1 / P + 1 / R) .