# Class-Level Refactoring Prediction by Ensemble Learning with Various Feature Selection Techniques
## 3 Research Methodology
### Artificial Neural Network  
We used ANN to classify the heterogeneous ensemble structure as a model of neuro-computing (base-classifier). ANNs with different learning or weight estimation approaches are used as the basis learners in this study. The next sections go into great detail regarding the ANN models that were used in this study. ANN has become one of the most used and sought-after algorithms among the major neuro-computing ideas. It works similarly to the human brain in that it learns from different data or patterns to classify data it has not seen before (s). ANN is a possible significant Artificial Intelligence solution (AI) or decision making task because of how well it learns, how well it learns about depth information, and how well it can classify related information. It is made up of many neurons that send data to different layers, such as the input layer and the hidden layer, to be processed. In the end, classification output is given at the output layer in Figure 2. It uses concepts to reduce errors to learn from the given data. It determines the difference between the expected and observed values, called error. It plans to keep lowering the error until it reaches zero, which means convergence and gives the final output of the output layer. At the output layer, ANN sorts the data it has received into the expected groups. For example, this paper divides each class into two groups: those that are easy to refactor and those that are not.  
In practice, obtaining the best classification result requires choosing the right weights, computing quickly, and so on. Otherwise, it goes through local minima and premature convergence, which hurts the overall computing efficiency. ANN requires accurate weight estimates and high learning efficiency to fix these problems and reach a point where there are no mistakes. To achieve this, ANN undergoes several phased changes that have made it better at estimating weight and learning. In this paper, we refactored classification with ANN in different ways. These algorithms (ANN-GD, ANN-GDX, ANN-LM, and ANN-RBF) were used as base learners to create an ensemble.  
An ANN model typically consists of input, hidden, and output layers (see Figure 2 for a visual representation). A linear activation function is applied to the neural network to produce the same output (\(O_{h}=I_{h}\)) as the input in our proposed refactoring prediction model. The hidden layer uses data from the input layer to feed into its sigmoid function to arrive at the result \(O_{h}\). With the hidden layer \(I_{h}\), ANN produces \(O_{h}\) at the output layer using the sigmoid function, as Equation (11).  
\[O_{h}=\frac{1}{1+e^{-I_{h}}} \tag{11}\]  
Most of the time, ANN is written as \(Y^{\prime}\)= f (W,X), where \(Y^{\prime}\) is the output vector and W and X are the weights. ANN aims to reduce the error function to improve the algorithm's accuracy. So, a mean square error (\(MSE\)) function was used as Equation (12).  
\[MSE=\frac{1}{n}\sum_{i=1}^{n}\left(y_{i}-y_{i}^{\prime}\right)^{2} \tag{12}\]  
In above Equation (12), the parameter \(y\) shows the calculated value, while \(y_{i}\) shows the intended result. With our planned refactoring prediction system in mind, we fed 125 code metrics into the ANN, allowing the ANN to determine whether each class needed refactoring. So, it gives each class of software code a label, which is then used by a maximum voting ensemble to decide whether the code class is likely to be refactored or not. As was already said, we used different kinds of ANN in this research, such as ANN-GD,  
Figure 2: A typical ANN structure.  
ANN-RBF, ANN-LM, etc. Then we have discussed a small part of these algorithms and how they determine their weights and learn for refactoring prediction at the class level.