Evaluation Metrics in Machine Learning#
Regarding this section, I will provide a brief explanation and introduction when encountered, focusing only on the most important parts; others can refer to relevant literature and blog articles.
1. About P and R Values#
These are probably the two most commonly used statistics in machine learning. To calculate them, we need to compute the confusion matrix, with the simplest version being the following four-item version.
| Predicted Positive | Predicted Negative | |
|---|---|---|
| Truth: True | TP | FN |
| Truth: False | FN | TN |
In this table, the second item represents the predicted values, while the first item corresponds to the true values, where the same is True and different is False. Based on this table, we can derive various physical quantities, the most commonly used being P (Precision), R (Recall), and Accuracy. Below are their calculation formulas:
P = TP / (TP + FP)
R = TP / (TP + FN)
Accuracy = (TP + TN) / (TP + FN + FP + TN)
Their meanings are relatively easy to understand, so I won't elaborate further.
- Calculation of F Value
The calculation of F is the weighted harmonic mean of P and R. How should we understand it, and why use this form? If you look closely, you will find that the commonly used F1 value has a formula similar to the formula for resistors in parallel:
F = 2PR / (P + R)
-
Others
Based on these statistics, there are many other derived metrics and curves used to characterize different performances, commonly including PR curves, AOC curves, etc. These are not complicated and can be looked up when needed. -
References
https://www.cnblogs.com/Zhi-Z/p/8728168.html