Skip to main content
QUICK REVIEW

[论文解读] The impact of using biased performance metrics on software defect prediction research

Jingxiu Yao, Martin Shepperd|arXiv (Cornell University)|Mar 18, 2021
Software Engineering Research参考文献 72被引用 5
一句话总结

本研究通过在包含12,471对比较的38项主要研究中,将有偏的F1度量与无偏的Matthews相关系数(MCC)进行对比,调查了在软件缺陷预测研究中使用有偏F1度量的影响。研究发现,当改用MCC时,21.95%的结果方向发生改变,凸显了因度量偏差导致错误结论的重大风险。

ABSTRACT

Context: Software engineering researchers have undertaken many experiments investigating the potential of software defect prediction algorithms. Unfortunately, some widely used performance metrics are known to be problematic, most notably F1, but nevertheless F1 is widely used. Objective: To investigate the potential impact of using F1 on the validity of this large body of research. Method: We undertook a systematic review to locate relevant experiments and then extract all pairwise comparisons of defect prediction performance using F1 and the un-biased Matthews correlation coefficient (MCC). Results: We found a total of 38 primary studies. These contain 12,471 pairs of results. Of these, 21.95% changed direction when the MCC metric is used instead of the biased F1 metric. Unfortunately, we also found evidence suggesting that F1 remains widely used in software defect prediction research. Conclusions: We reiterate the concerns of statisticians that the F1 is a problematic metric outside of an information retrieval context, since we are concerned about both classes (defect-prone and not defect-prone units). This inappropriate usage has led to a substantial number (more than one fifth) of erroneous (in terms of direction) results. Therefore we urge researchers to (i) use an unbiased metric and (ii) publish detailed results including confusion matrices such that alternative analyses become possible.

研究动机与目标

  • 评估使用有偏F1度量对软件缺陷预测研究有效性的影响。
  • 识别尽管已知存在统计局限性,F1在缺陷预测研究中仍被频繁使用的频率。
  • 确定F1最具误导性的条件,特别是在类别不平衡数据集中的情况。
  • 在大量实证研究中,将F1结果与无偏的Matthews相关系数(MCC)进行比较。
  • 倡导在将来的研究中采用无偏度量,并透明地报告混淆矩阵。

提出的方法

  • 开展系统性回顾,以识别报告软件缺陷预测实验中F1和MCC得分的原始研究。
  • 从报告了F1和MCC的38项原始研究中提取了12,471对模型性能的比较。
  • 进行元分析,以评估在从F1切换到MCC时,比较方向(如模型A优于模型B)是否发生变化。
  • 通过混淆矩阵排列的理论与实证分析,研究类别不平衡在加剧F1偏差方面的作用。
  • 利用统计学与机器学习文献,批判F1在信息检索场景之外的二分类任务中的局限性。
  • 通过Zenodo(DOI: 10.5281/zenodo.4899090)公开原始数据与分析代码,以确保可重现性并支持进一步分析。

实验结果

研究问题

  • RQ1在软件缺陷预测研究中,选择F1还是MCC会导致性能比较方向发生反转的频率如何?
  • RQ2尽管已知存在统计问题,F1在近期软件缺陷预测研究中的使用频率如何?
  • RQ3在何种条件下——尤其是类别不平衡时——F1最可能产生误导性结果?
  • RQ4由于度量偏差,文献中基于F1的结论在多大程度上可能无效?
  • RQ5通过用MCC替代F1并公开完整的混淆矩阵,可在研究透明度与有效性方面实现哪些改进?

主要发现

  • 在分析的12,471对比较中,有21.95%在从F1切换到MCC时改变了方向,表明由于度量偏差,存在重大错误结论风险。
  • 尽管已知存在统计缺陷,F1在软件缺陷预测研究中仍被广泛使用,2015–2020年间超过三分之一的研究仍依赖该度量。
  • F1度量在类别不平衡数据集中尤其成问题,其系统性地偏向于高精确率或高召回率的模型,而牺牲整体平衡性。
  • Matthews相关系数(MCC)是软件缺陷预测中二分类任务比F1更稳健、更无偏的替代度量。
  • 本研究证明,F1可能因对类别分布敏感以及对假正例和假反例的非对称处理,导致研究人员错误选择次优模型。
  • 作者提供了证据表明,公开完整的混淆矩阵可支持替代度量分析,从而提升缺陷预测研究的可重现性与有效性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。