计算机科学与探索

• 学术研究 •    

超参数优化对跨版本缺陷预测影响的实证研究

韩惠,于巧,祝义   

  1. 江苏师范大学 计算机科学与技术学院,江苏 徐州 221116

The Impact of Hyperparameter Optimization on Cross-version Defect Prediction: An Empirical Study

HAN Hui, YU Qiao, ZHU Yi   

  1. School of Computer Science and Technology, Jiangsu Normal University, Xuzhou, Jiangsu 221116, China

摘要: 在机器学习领域,超参数是影响模型性能的关键因素之一。已有研究表明,超参数优化能够显著提升版本内缺陷预测和跨项目缺陷预测的性能,而对跨版本缺陷预测性能的影响尚不明确。本文针对超参数优化对跨版本缺陷预测的影响进行探究,以模型在前序版本(训练集)十折交叉验证最优AUC值为优化目标,选取五种经典缺陷预测模型(决策树、K-近邻、随机森林、支持向量机和多层感知机)以及四种常用超参数优化算法(基于TPE和基于概率随机森林的贝叶斯优化算法、随机搜索算法和模拟退火算法),在PROMISE数据集上展开实证研究。研究结果表明:(1)决策树、K-近邻和多层感知机模型超参数优化后,跨版本缺陷预测AUC值得到显著提升;(2)超参数优化后的模型仍保持与默认超参数设置下的模型相当的稳定性;(3)除了较为复杂的多层感知机模型,其余模型超参数优化的时间平均为1-2分钟,超参数优化的时间成本是在可接受范围之内的。上述结果表明,在跨版本缺陷预测中应考虑对模型进行超参数优化以提升预测性能。

关键词: 软件缺陷预测、跨版本缺陷预测、超参数优化

Abstract: In the field of machine learning, hyperparameters are one of the key factors that affect prediction performance. Previous studies have shown that optimizing hyperparameters can improve the performance of inner-version defect prediction and cross-project defect prediction, but the impact on the performance of cross-version defect prediction is unclear. This paper explores the impact of hyperparameter optimization on cross-version defect prediction. The optimization goal is the model's optimal AUC performance of 10-fold cross-validation in previous version (training set). Five classical defect prediction models (Decision Tree, K-Nearest Neighbors, Random Forests, Support Vector Machine and Multi-Layer Perceptron) and four common hyperparameter optimization algorithms (Bayesian Optimization Based on TPE and Sequential Model-Based Optimization for General Algorithm Configuration, Random Search and Simulated Annealing) are selected and the empirical study is conducted on PROMISE datasets. The results indicate that: (1) There is an obvious improvement in the AUC index of cross-version defect prediction after optimizing the Decision Tree, K-Nearest Neighbors and Multi-Layer Perceptron models. (2) The optimal models still maintains the same stability as the default hyperparametric models. (3) Hyperparameter optimization take 1-2 minutes for all models on average except the complicated multi-layer perceptron model, time cost is within an acceptable range. The above results indicate that the hyperparameter optimization of the model should be considered in the process of cross-version defect prediction to improve its performance.

Key words: Software Defect Prediction, Cross-Version Defect Prediction, Hyperparameter Optimization