A Stacked Regressor for the Prediction of the Number of Defects in Software Modules
Abstract
: This study proposes a Stacked Regressor (SR) model for software defect count prediction. The approach combines four heterogeneous base learners—Support Vector Regression (SVR), k -Nearest Neighbors (KNN), Random Forest Regressor (RFR), and Extra Trees Regressor (ETR)—whose predictions are aggregated through a meta-regressor. Two SR variants are implemented, differing only in the choice of the meta-regressor: SVR or RFR. The models are evaluated on 10 publicly available software projects comprising 34 versions under within-version and within-project settings. Experimental results show that the proposed SR approach consistently outperforms individual base learners in terms of MAE and MRE, while remaining competitive in RMSE and Pred(0.3). Statistical analysis further supports the robustness of the observed improvements. These findings indicate that stacking heterogeneous regression models can enhance the stability and generalization of software defect count prediction.