# An Empirical Evaluation of Ensemble Models for Python Code Smell Detection
## 5 Discussion
### A Comparative Analysis of Our Approach with Other Relevant Studies  
This section presents a comparative evaluation of the proposed ensemble-based framework against relevant studies in Python code smell detection. [PERSON] et al. [PERSON] et al. (2019) provided a foundational benchmark using traditional ML models but did not explore ensemble methods or data preprocessing techniques like feature selection and class balancing. Our approach surpasses [PERSON] et al. 's results across both datasets. For the LC dataset, [PERSON], [PERSON] et al. [PERSON] et al. (2019) obtained a 0.93 accuracy score and a 0.77 MCC score using the random forest method with the gain ratio FST. In contrast, this approach demonstrated superior performance, achieving the best accuracy score of 0.96 and MCC score of 0.85 using the max voting method with applied chi-square FST and SMOTE class balancing techniques. For the LM dataset, [PERSON], [PERSON] et al. [PERSON] et al. (2019) obtained a 0.96 accuracy score and a 0.90 MCC score using the decision tree method with the gain ratio FST. Once again, the proposed approach demonstrated its significance, achieving the best accuracy score of 0.98 and MCC score of 0.94 using the Gradient Boosting method with applied chi-square FST and SMOTE techniques. This confirms the superiority of ensemble models, especially when supported by FST and SMOTE. Compared to other studies, such as those by [PERSON] et al. [PERSON] et al. (2019), which used the PySmell Tool and scored 97.7% precision but lacked robustness metrics like MCC, [PERSON] et al. [PERSON] et al. (2019) applied eight ML models with logistic regression, forward stepwise selection, and correlation FST to find code smells in the Python dataset. The result identified 99.72% maximum accuracy for the LM and Long base class list. However, the limited dataset diversity and lack of ensemble techniques reduce the generalizability of these findings. [PERSON] et al. [PERSON] et al. (2019) used the AdaBoost method for severity detection and obtained 92.98% best accuracy but did not address class imbalance, FST, or use multiple ensembles. Table 9 contextualizes our method's performance against these works, showing consistent advantages in accuracy and MCC, particularly for real-world Python datasets. Our experiments show that SMOTE improves recall, reducing false negatives without significantly degrading precision. This suggests that overfitting is not a concern in this setup. Furthermore, applying a 10-fold cross-validation ensures that synthetic instances do not bias generalization. SMOTE's role in improving MCC scores across ensemble models confirms its effectiveness in enhancing minority class detection and classification stability. The combination of Max Voting and Gradient Boost ensembles, shi-square FST, and SMOTE-based balancing sets this approach apart from prior studies. This robust configuration addresses known limitations, such as imbalance, noise, and overfitting that were not fully mitigated in earlier Python-based work. The significant improvement over established benchmarks supports the potential of our approach as a new baseline for future research in language-specific code smell detection. For the LC and LM datasets, the ensemble learning methods obtained better accuracy and MCC scores than the ML models. This is because ensemble learning is a learning strategy that combines many ML models. One issue with ML is the poor performance of individual models, and sometimes their forecast accuracy is low. However, it is important to note that the proposed approach also has its limitations, such as the need for large amounts of training data and longer training times. In this context, the chi-square FST and SMOTE play a crucial role in enhancing accuracy, providing valuable tools for improving ML performance.