【机器学习】(周志华--西瓜书) 真正例率(TPR)、假正例率(FPR)与查准率(P)、查全率(R)

本文深入探讨了在机器学习模型评估中至关重要的几个指标,包括真正例率(TPR)、假正例率(FPR)、查准率(P)、查全率(R)等,解释了它们之间的联系和区别,帮助读者理解如何全面评价模型效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Q:试述真正例率(TPR)、假正例率(FPR)与查准率(P)、查全率(R)之间的联系。
查全率: 真实正例被预测为正例的比例 
真正例率: 真实正例被预测为正例的比例 
显然查全率与真正例率是相等的。 
查准率:预测为正例的实例中真实正例的比例 
假正例率: 真实反例被预测为正例的比例 
两者并没有直接的数值关系。

敏感度召回率命中率真实阳性率(TPR)

{\ displaystyle \ mathrm {TPR} = {\ frac {\ mathrm {TP}} {P}} = {\ frac {\ mathrm {TP}} {\ mathrm {TP} + \ mathrm {FN}}} = 1 -  \ mathrm {FNR}}

特异性选择性真阴性率(TNR)

{\ displaystyle \ mathrm {TNR} = {\ frac {\ mathrm {TN}} {N}} = {\ frac {\ mathrm {TN}} {\ mathrm {TN} + \ mathrm {FP}}} = 1 -  \ mathrm {FPR}}

精度阳性预测值(PPV)

{\ displaystyle \ mathrm {PPV} = {\ frac {\ mathrm {TP}} {\ mathrm {TP} + \ mathrm {FP}}} = 1- \ mathrm {FDR}}

阴性预测值(NPV)

{\ displaystyle \ mathrm {NPV} = {\ frac {\ mathrm {TN}} {\ mathrm {TN} + \ mathrm {FN}}} = 1- \ mathrm {FOR}}

未命中率或误报率(FNR)

{\ displaystyle \ mathrm {FNR} = {\ frac {\ mathrm {FN}} {P}} = {\ frac {\ mathrm {FN}} {\ mathrm {FN} + \ mathrm {TP}}} = 1 -  \ mathrm {TPR}}

跌落误报率(FPR)

{\ displaystyle \ mathrm {FPR} = {\ frac {\ mathrm {FP}} {N}} = {\ frac {\ mathrm {FP}} {\ mathrm {FP} + \ mathrm {TN}}} = 1 -  \ mathrm {TNR}}

错误发现率(FDR)

{\ displaystyle \ mathrm {FDR} = {\ frac {\ mathrm {FP}} {\ mathrm {FP} + \ mathrm {TP}}} = 1- \ mathrm {PPV}}

错误遗漏率(FOR)

{\ displaystyle \ mathrm {FOR} = {\ frac {\ mathrm {FN}} {\ mathrm {FN} + \ mathrm {TN}}} = 1- \ mathrm {NPV}}


准确度(ACC)

{\ displaystyle \ mathrm {ACC} = {\ frac {\ mathrm {TP} + \ mathrm {TN}} {P + N}} = {\ frac {\ mathrm {TP} + \ mathrm {TN}} {\ mathrm {TP} + \ mathrm {TN} + \ mathrm {FP} + \ mathrm {FN}}}}

F1得分

调和平均精确度灵敏度

{\ displaystyle F_ {1} = 2 \ cdot {\ frac {\ mathrm {PPV} \ cdot \ mathrm {TPR}} {\ mathrm {PPV} + \ mathrm {TPR}}} = {\ frac {2 \ mathrm {TP}} {2 \ mathrm {TP} + \ mathrm {FP} + \ mathrm {FN}}}}

马修斯相关系数(MCC)

{\ displaystyle \ mathrm {MCC} = {\ frac {\ mathrm {TP} \ times \ mathrm {TN}  -  \ mathrm {FP} \ times \ mathrm {FN}} {\ sqrt {(\ mathrm {TP} + \ mathrm {FP})(\ mathrm {TP} + \ mathrm {FN})(\ mathrm {TN} + \ mathrm {FP})(\ mathrm {TN} + \ mathrm {FN})}}}}

知情或博彩知情(BM)

{\ displaystyle \ mathrm {BM} = \ mathrm {TPR} + \ mathrm {TNR} -1}

标记(MK)

{\ displaystyle \ mathrm {MK} = \ mathrm {PPV} + \ mathrm {NPV} -1}

 

https://en.wikipedia.org/wiki/Receiver_operating_characteristic

### 关于《机器学习周志华西瓜课后习题解析 #### 不同章节的习题特点解决方法 对于不同章节中的具体题目,解决方案各有侧重。例如,在第九章中提到的内容涉及较为复杂的模型评估技术应用[^1]。 #### 构建不剪枝决策树的具体案例分析 当处理特定的数据集如西瓜数据3.0α时,构建不剪枝决策树的过程不同于简单的决策桩。这里需要考虑更多的节点分裂标准以及如何全面地利用特征属性进行划分,而不是仅仅依赖单一条件做出判断[^2]。 #### 计算假设空间大小的方法探讨 针对西瓜分类问题中的假设空间计算,如果采用最多包含k个合取式的析合范式,则可以通过组合数学的方式估计可能存在的假设数量。这涉及到对给定条件下所有潜在模式的理解量化[^3]。 #### 版本空间的概念及其求解过程说明 版本空间是指既能够解释已有观察又尽可能泛化到未见实例的一组假设集合。通过移除那些无法匹配已知正例或反而能解释负例的候选方案,可以逐步缩小这一范围直至找到最优解[^4]。 ```python def calculate_hypothesis_space_size(attributes, values_per_attribute): """ Calculate the size of hypothesis space given attributes and their possible value counts. :param attributes: List of attribute names :param values_per_attribute: Dictionary mapping each attribute to its number of distinct values :return: Total number of hypotheses in the space """ total_combinations = 1 for attr in attributes: if attr in values_per_attribute: total_combinations *= (values_per_attribute[attr] + 1) # Include wildcard '*' return total_combinations - 1 # Exclude completely wild card case '* * ...' # Example usage based on provided information from reference [3] attributes = ["色泽", "根蒂", "敲声"] value_counts = {"色泽": 2, "根蒂": 2, "敲声": 2} print(f"The estimated number of possible hypotheses is {calculate_hypothesis_space_size(attributes, value_counts)}") ```
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值