# Cross-Project Defect Prediction Based on Domain Adaptation and LSTM Optimization
## 3 Methodology
### Proposed Features Selection Approach  
The prediction performance of CPDP models might be lowered by the presence of redundant or irrelevant features. By focusing on the most relevant features, the model may better capture the underlying patterns in the data and produce more accurate forecasts of \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Reference** & **Proposed Techniques** & **Datasets** & **Advantages** & **Limitation** \\ \hline [PERSON] et al., (2019) & ITrda-Boost, or transfer & & & Set to work the idea of stratification integrated in closest neighbor (STr-NN). To reduce the data distribution & Needs to be examined in light of its viability in comparison to other relevant models. \\ [PERSON] et al., (2019) & Inductive boosting, is a technique for handling small amounts of labeled data. & & & \\  & & & & \\  & & & & \\  & & & & \\  & & & & \\  & & & & \\ \hline [PERSON] et al., & K-Nearest Neighbor with & & Combined filter and wrapper methods with Mutual & \\  & 10-fold cross-validation & UCI repository & Information, the Sequential & To validate the system, the model’s performance feasibility should be assessed. \\  & & Forward Selection. & & cross-validation were used to choose the best features. & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._  
Figure 1: Overview of the proposed methodology for CPDP. defects in new projects [41]. We employ correlation-based feature selection (CFS) in the proposed framework, which chooses a subset of characteristics by taking into consideration each feature's unique predictive capacity, as well as the degree of redundancy among them. The best-first search technique is employed to discover a feature subset in which these features have a strong correlation with regard to the target class labels, while having a low correlation within each other (Figure 2). CFS begins by employing a correlation metric to determine the value of each individual feature \(F\) and each feature set \(f_{1}\), \(f_{2}\),..., \(f_{n}\), as illustrated in Algorithm 1. It initializes each feature as \(f_{i}\) with the empty set \(S\). Then, it selects the feature with the highest merits and adds it to the selected subset, while removing it from the remaining features. The process continues until the merit no longer changes considerably. Eventually, the algorithm returns the chosen subset \(S\), which includes the most informative information for CPDP defect prediction. ```
Input: - \(F\), Feature set with n features, \(=f_{1},f_{2},\ldots,f_{n}\) Output: - \(S\), selected features
1. Initialize an empty set S and sets \(f_{1}\), \(f_{2}\),..., \(f_{n}\) with each feature \(f_{i}\)
2. Compute the merit of each feature \(f_{i}\) in F. Compute the weight of each individual feature set (\(f_{1}\), \(f_{2}\),..., \(f_{n}\)) using a suitable metric (e.g., correlation). 3. Select the feature with the highest weight from \(F\), add it to \(S\), and remove it from \(F\)
4. Compute the weight of the current subset \(S\)
5. Select the new feature from \(F\) with the highest merit, compute the merit of the updated subset, and compare it with the previous merit
6. If the merit of the new subset is not better than the previous subset,
7. Remove the selected feature from \(S\)
8. Else,
9. Update \(S\), remove the selected feature from \(F\)
10. Repeat steps 5-9 until the merit does not change significantly

Return the selected features \(S\)

Figure 2: Workflow of CFS. ### Proposed Imbalanced Learning Approach

The term \"class imbalance\" refers to circumstances in which there are significantly fewer examples of one class than of others. Models trained on imbalanced datasets tend to exhibit a bias towards the majority class, leading to significant false negative rates, when real defects are neglected or misclassified as non-defective cases. Moreover, the addition of noisy and irrelevant occurrences among source and target projects also influences the prediction performance of CPDP models. A number of data balancing techniques have been developed to address the issue of imbalanced classes.