🧮 Precision, Recall and F1 Calculator
Compute precision, recall and F1 from true positives, false positives and false negatives. Useful for threshold selection on imbalanced data.
📐 计算公式 / 原理
精确率 P = TP/(TP+FP);召回率 R = TP/(TP+FN);F1 = 2TP/(2TP+FP+FN)。TP=0 且两分母有效时 P=R=0、F1=0;分母为 0 时对应指标标“无定义”。
P 与 R 天然此消彼长:放宽阈值召回升高但误报增多。F1 用调和平均综合两者,对较小的一方更敏感(接近 0 时 F1 也接近 0),适合作为单一权衡指标;若业务更看重漏检(如疾病筛查)应改用 F2 加权召回。
📐 计算公式与说明
P = TP/(TP+FP),R = TP/(TP+FN),F1 = 2TP/(2TP+FP+FN)
精确率关注预测正确性,召回率关注覆盖度。