Classification at a fixed threshold
True positives (TP) and true negatives (TN) are correct predictions. False positives (FP) and false negatives (FN) are errors. Define which class is positive before interpreting a metric.
- Precision: TP / (TP + FP), the share of positive predictions that are actually positive.
- Recall: TP / (TP + FN), the share of actual positives identified.
- False-positive rate: FP / (FP + TN), the share of actual negatives incorrectly flagged.
- Accuracy: (TP + TN) / (TP + FP + TN + FN), the share of all predictions correct.
- F1: 2TP / (2TP + FP + FN), a harmonic balance of precision and recall.
A denominator of zero makes the corresponding ratio undefined. Metrics change with the threshold, population, label quality, and prevalence.
TP = 30, FP = 10, TN = 50, FN = 10. Precision = 30/40 = 75%, recall = 30/40 = 75%, false-positive rate = 10/60 ≈ 16.7%, and accuracy = 80/100 = 80%.
Regression and forecasting
- MAE: average absolute error, in the target’s units.
- MSE: average squared error, in squared units; large errors have greater influence.
- RMSE: square root of MSE, expressed in the target’s units.
For errors of 2, −4, and 6, MAE = 4, MSE = 56/3 ≈ 18.67, and RMSE ≈ 4.32. Inspect signed errors and relevant slices as well: an average absolute error does not reveal systematic overprediction or underprediction. For forecasts, compare methods on the same historical origins and horizon without using future information.
Retrieval and index quality
For a query with five relevant documents, a system retrieving three of them in its top ten has relevance recall at ten of 3/5 = 60%. Precision at ten is 3/10 = 30%, assuming all ten returned documents were judged and exactly three were relevant.
Approximate-index recall is a different comparison: if an approximate search returns eight of the ten exact nearest neighbors under the same index inputs and filters, its index recall at ten is 80%. Exact neighbors are not automatically relevant, authorized, or current. Evaluate evidence and final answers separately.