Ensemble methods are widely used in cross-project defect prediction (CPDP), particularly in projects that lack sufficient historical data by training on external source projects. However, no prior study has compared Bagging, Boosting, and Stacking directly under a Leave-One-Project-Out (LOPO) protocol or examined whether within-project performance rankings carry over to the cross-project setting. We evaluated three ensemble classifiers on five NASA MDP datasets sharing a common Halstead and McCabe feature schema. SMOTE is applied exclusively to pooled source data to prevent leakage into the target. A no-SMOTE baseline isolates the contribution of source-only SMOTE. LIME explanations are aggregated over thirty instances per model to assess feature importance consistency across the project boundary. Within-project evaluation shows Stacking achieves the highest F1 on four of five datasets, peaking at 0.503 on KC1. Under LOPO, these rankings reverse as Bagging and Boosting transfer more reliably, while Stacking's F1 drops by up to 0.258 points. Source-only SMOTE consistently improves transfer across all targets and ensembles. LIME consistency analysis produces undefined Spearman rank correlations, indicating that thirty-instance aggregation is insufficient to produce stable rank vectors for 21-feature datasets. To the best of our knowledge, this is the first study to compare all three ensemble strategies under LOPO on a shared NASA dataset feature schema. Particularly with a no-SMOTE control, aggregated LIME analysis, and a pilot meta-feature study identifying dataset size as the most actionable label-free predictor of ensemble suitability for CPDP deployment.
Copyrights © 2026