准确率,精准率和召回率(Accuracy、precision & Recall)

最重要分清四个变量:
https://en.wikipedia.org/wiki/Sensitivity_and_specificity

  1. True positive (TP): e.g., Sick people correctly identified as sick
  2. False positive (FP): e.g., Healthy people incorrectly identified as sick
  3. True negative (TN): e.g., Healthy people correctly identified as healthy
  4. False negative (FN): e.g., Sick people incorrectly identified as healthy

In general, Positive = identified and negative = rejected. Therefore:

  1. True positive = correctly identified
  2. False positive = incorrectly identified
  3. True negative = correctly rejected
  4. False negative = incorrectly rejected

所以:
condition positive (P):the number of real positive cases in the data
condition negative (N):the number of real negative cases in the data

P = TP + FN, F = TN + FP


准确率 Accuracy = (TP + TN) / (P + N) = (TP + TN) / (TP + FN + TN + FP)

精确率Precision = TP / (TP + FP)

召回率Recall = TP / P = TP / (TP + FN)

F1-Score = 2 * (Precision * Recall) / (Precision + Recall) = 2 * TP / (2 * TP + FP +FN)


示例说明:
1000个病人,现被确诊400个病人,600个健康人。
这400个病人实际上有300个病人(TP)和100给误判的健康人(FP);
而这判定为健康的600人中,有500个是健康人(TN),100个病人(FN)。
即: TP = 300, FP = 100, TN = 500, FN = 100.

注:实际上的患者为500人(P = TP + FN),500个健康人(F = TN + FP

所以:
准确率Accuray = (TP + TN) / (TP + FN + TN + FP) = 800 / 1000 = 80%
精确率Precision = TP / (TP + FP) = 300 / (300 + 100)= 75%
召回率Recall = TP / (TP + FN) = 300 / (300 + 100) = 75%
F1-score = 2 * (Precision * Recall) / (Precision + Recall) = 75%

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值