Skip to main content
QUICK REVIEW

[论文解读] Run, Forest, Run? On Randomization and Reproducibility in Predictive Software Engineering

Cynthia C. S. Liem, Annibale Panichella|arXiv (Cornell University)|Dec 15, 2020
Software Engineering Research参考文献 96被引用 4
一句话总结

本文研究了随机化对预测性软件工程中可复现性的影响,揭示了由于不受控的数据采样、随机种子和特定库的实现方式,导致广泛存在的不一致现象。本文提出了五项实用指南,通过重复运行、明确报告参数以及在多个库和数据集上进行统计验证,以提升可复现性。

ABSTRACT

Machine learning (ML) has been widely used in the literature to automate software engineering tasks. However, ML outcomes may be sensitive to randomization in data sampling mechanisms and learning procedures. To understand whether and how researchers in SE address these threats, we surveyed 45 recent papers related to three predictive tasks: defect prediction (DP), predictive mutation testing (PMT), and code smell detection (CSD). We found that less than 50% of the surveyed papers address the threats related to randomized data sampling (via multiple repetitions); only 8% of the papers address the random nature of ML; and parameter values are rarely reported (only 18% of the papers). To assess the severity of these threats, we conducted an empirical study using 26 real-world datasets commonly considered for the three predictive tasks of interest, considering eight common supervised ML classifiers. We show that different data resamplings for 10-fold cross-validation lead to extreme variability in observed performance results. Furthermore, randomized ML methods also show non-negligible variability for different choices of random seeds. More worryingly, performance and variability are inconsistent for different implementations of the conceptually same ML method in different libraries, as also shown through multi-dataset pairwise comparison. To cope with these critical threats, we provide practical guidelines on how to validate, assess, and report the results of predictive methods.

研究动机与目标

  • 评估预测性软件工程领域的研究人员在数据采样、模型训练和实现选择中,多大程度上解决了随机化威胁。
  • 研究在常见机器学习分类器中,由于随机数据重采样和随机种子导致的性能变异性程度。
  • 评估在相同算法和模型配置下,不同机器学习库之间结果的一致性。
  • 识别近期软件工程文献中在超参数、随机种子和库版本报告方面的不足之处。
  • 提出并制定实用、可操作的指南,以改善预测性软件工程研究中的可复现性。

提出的方法

  • 对45篇近期论文(涵盖缺陷预测、预测性变异测试和代码异味检测)进行了系统性文献综述,以评估其对随机化和参数设置的报告情况。
  • 使用26个真实世界的SE数据集和三种主流机器学习库(scikit-learn、Weka、R)中的八种监督学习分类器,开展了实证研究。
  • 对每个数据集和模型配置执行100次重复运行,以测量由于随机种子选择和10折交叉验证中的数据重采样所导致的变异性。
  • 比较在不同库中实现的相同模型配置的结果,以评估实现一致性以及默认超参数的差异。
  • 采用Friedman检验结合事后Nemenyi检验,评估不同模型之间性能差异的统计显著性。
  • 提出了五项基于证据的指南,以提升可复现性,包括重复运行、明确报告种子和参数,以及关注求解器和库的行为。

实验结果

研究问题

  • RQ1近期的预测性SE论文在多大程度上报告了随机数据采样过程和多次重复实验?
  • RQ2在常见分类器中,不同随机种子在机器学习训练过程中导致的性能变异性有多大?
  • RQ3尽管概念配置相同,不同机器学习库实现的相同算法结果一致性如何?
  • RQ4未报告或不一致的超参数和库版本对结果可复现性有何影响?
  • RQ5哪些统计和报告实践能够提升预测性SE结果的可靠性和可复现性?

主要发现

  • 在调查的论文中,不到50%通过多次重复实验解决了数据重采样带来的变异性,表明方法论严谨性存在重大缺口。
  • 仅有8%的论文明确报告或控制了机器学习训练中的随机种子,尽管不同种子导致的性能变异性显著。
  • 即使超参数描述完全相同,同一机器学习模型在不同库中的实现结果也存在显著差异。
  • 默认参数值(如随机森林中的树的数量)在不同库版本间发生了显著变化,导致结果不一致。
  • 统计分析表明,尽管随机森林始终排名靠前,但在校正多重比较后,其性能并不显著优于其他模型。
  • 本研究证明,不同库的默认配置存在广泛差异,严重损害了可复现性,因此必须明确报告库名称、版本和参数设置。

更好的研究,从现在开始

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

无需绑定信用卡

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