# Class-Level Refactoring Prediction by Ensemble Learning with Various Feature Selection Techniques
## 3 Research Methodology
### System Model  
This section describes the multi-phased process for refactoring prediction at the class level and considers the overall research goal. The prime intention is to design a novel and robust automatic refactoring detection and classification system. This research incorporates a multi-phased optimization measure, focusing on enhancing all key functional components, including pre-processing and data augmentation, feature extraction, and feature selection, followed by ensemble-assisted classification. Distinct from conventional research, different authors have merely focused on applying classical classification algorithms such as Naive Bayes, SVM, or ANN to perform classification over limited code metrics. We exploit the software program's major possible structural artifacts to assess its significance in characterizing refactoring proneness. Observing the significant existing literature and their inferences where it has been found that code bug-proneness or smell directly relates to refactoring probability, we consider this trait (i.e., code-smell) as a refactoring signifier to perform (refactoring) classification.  
The phases of our proposed model are shown in Figure 1 and the model encompasses the following processes.  
This research hypothesizes that structural traits such as (code) size, inheritance, complexity, cohesion, coupling, etc., directly relate to code smell and refactoring probability. We applied benchmark data for refactoring analysis from the tera-PROMISE repository. Noticeably, tera-PROMISE data encompasses benchmark software data with different refactoring quotients. Obtaining a total of 125 features are extracted, which are later processed for the Wilcoxon significance (Rank sum) test (WRS), the Pearson correlation test (PCT), and principal component analysis was used in a multi-phased feature selection process (PCA). We obtained the feature set or data and performed data augmentation with sampling and normalization techniques. At first, we performed data augmentation with three different sampling methods: random, upsampling, and downsampling. Thus, to obtain the set of samples or data, we performed Min-Max normalization, which maps all inputs or data in the range of 0-1. Thus, the proposed data augmentation model alleviates data imbalance, avoiding problems with local minima and convergence. Once the normalized data is obtained, we presented our heterogeneous ensemble-based categorization model,  
Figure 1: Proposed methodology for refactoring prediction at the class level.  
which performs a class-level refactoring prediction. Distinct from conventional machine learning methods for refactoring analysis, in this research, classifiers from different types, such as decision trees, ANN methods, ELM methods, and SVM algorithms, were used as a novel heterogeneous ensemble model built around a base classifier. Employing the maximum voting ensemble (MVE) concept, our proposed method performed class-level refactoring assessment and classification that eventually exhibited better performance than the individual classifier as the standalone classification model. This section discusses the key techniques applied and the respective implementation details to design an automatic refactoring prediction model for software quality optimization.