Next Article in Journal
BERT-Based Joint Model for Aspect Term Extraction and Aspect Polarity Detection in Arabic Text
Previous Article in Journal
HD/FD Cooperative NOMA under UAV Deployment for a Novel Disaster-Management Model
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimal Feature Selection through Search-Based Optimizer in Cross Project

1
Faculty of Computing, Riphah International University, I-14 Campus Islamabad, Islamabad 46000, Pakistan
2
Industrial Engineering Department, College of Engineering, King Saud University, P.O. Box 800, Riyadh 11421, Saudi Arabia
3
Centre for Smart Systems, AI and Cybersecurity, Staffordshire University, Stoke-on-Trent ST4 2DE, UK
*
Author to whom correspondence should be addressed.
Electronics 2023, 12(3), 514; https://doi.org/10.3390/electronics12030514
Submission received: 23 December 2022 / Revised: 6 January 2023 / Accepted: 9 January 2023 / Published: 19 January 2023
(This article belongs to the Topic Software Engineering and Applications)

Abstract

:
Cross project defect prediction (CPDP) is a key method for estimating defect-prone modules of software products. CPDP is a tempting approach since it provides information about predicted defects for those projects in which data are insufficient. Recent studies specifically include instructions on how to pick training data from large datasets using feature selection (FS) process which contributes the most in the end results. The classifier helps classify the picked-up dataset in specified classes in order to predict the defective and non-defective classes. The aim of our research is to select the optimal set of features from multi-class data through a search-based optimizer for CPDP. We used the explanatory research type and quantitative approach for our experimentation. We have F1 measure as our dependent variable while as independent variables we have KNN filter, ANN filter, random forest ensemble (RFE) model, genetic algorithm (GA), and classifiers as manipulative independent variables. Our experiment follows 1 factor 1 treatment (1F1T) for RQ1 whereas for RQ2, RQ3, and RQ4, there are 1 factor 2 treatments (1F2T) design. We first carried out the explanatory data analysis (EDA) to know the nature of our dataset. Then we pre-processed our data by removing and solving the issues identified. During data preprocessing, we analyze that we have multi-class data; therefore, we first rank features and select multiple feature sets using the info gain algorithm to get maximum variation in features for multi-class dataset. To remove noise, we use ANN-filter and get significant results more than 40% to 60% compared to NN filter with base paper (all, ckloc, IG). Then we applied search-based optimizer i.e., random forest ensemble (RFE) to get the best features set for a software prediction model and we get 30% to 50% significant results compared with genetic instance selection (GIS). Then we used a classifier to predict defects for CPDP. We compare the results of the classifier with base paper classifier using F1-measure and we get almost 35% more than base paper. We validate the experiment using Wilcoxon and Cohen’s d test.

1. Introduction

For prediction of software, software defect proneness (SDP) is a study area that provides effective techniques. From previous versions of the same project, defective data can be used to detect fault proneness. At early stages of software development, prediction of defects in software subsystems (modules) plays a vital role in decreasing the development costs and time. It eradicates the excessive efforts to find defects from the software modules in later stages of the software development. Preceding studies in this research area consider the within project defect prediction (WPDP) in which the same data are used for training and predicting defects and are cross-validated [1]. However, according to [2], WPDP approach is only valid when there is a large dataset with less granularity. Yet, such approaches do not hold in training data specifically for inactive software projects.
In order to assure the quality of data, quality assurance activities help software engineers in testing defect modules and in code inspection to consume less time and facilitate more usage. Recently, software defect prediction (SDP) practice specifies defective modules based on metrics of software process and products. Thus, [3,4] use Chidamber and Kemerer (CK) metrics as a feature set to predict software prediction models (SPM) using logistic regression (LR). Whereas [5] used static code, metric (SCM), and object-oriented (OO) metrics. Some researchers used historical data from other projects [6]. Where [7,8] used feature subsets for feature selection i.e., SCM + OO + LOC (all), CK + LOC, and info-gain (IG) subsets.
Furthermore, there are many open-source public datasets available such as Apache, NASA, Tera PROMISE data repositories. However, many researchers provide results to overwhelm the problem of WPDP in context of CPDP. Cross project defect prediction (CPDP) is an approach of using historical data from different projects which has been experimentally proven by different researchers [9,10]. The defects are available on the given available open-source public datasets on the Internet. Therefore, quality of data is very crucial for training data for better software model prediction. Data quality is one of the challenging tasks therefore, for CPDP, there are two solutions to this problem.
One of the solutions given by researchers is feature selection (FS), which is validated on different datasets in order to reduce dimensions in the projects. The results validate that using FS approach improves the performance and efficiency of SDP [1,10]. Second solution used by researchers is reducing the data size of training data [11,12] by selecting suitable and excluding irrelevant training data. Training data selection (TDS) is considered preferable for the simplification of data volume to get better prediction in terms of software defect prediction. Hence, the above-mentioned techniques and methods were used to address the most important issues, such as quality of data and defect-prone modules for software prediction models. Some researchers applied boosting and bagging technique, and others used filter and wrapper approaches and local data from previous projects. Therefore, we used one feature selection (FS) method i.e., info-gain sub setting [7] in conducting research analysis and used all features in our experiment. For filtering approach, we used the ANN-filter; for optimal feature sets, we used the random forest ensemble (RFE) technique; and in the end, we used classifier [13,14] for predicting the software prediction model (SPM).

2. Literature Review

It is evident from the research analysis among all feature selection (FS) methods i.e., Info-Gain (IG) sub setting [7] improved the defect prediction accuracy. Because of which, IG in combination with filter (ANN) for feature selection gives optimal feature for better classification [2]. Besides the existing literature, critical analysis reveals gaps that the dataset is multi-class and has issues in noise, class imbalance, and distribution gap. However, we believe that by combining all these techniques, defect prediction accuracy for multi-class in cross-project can be improved.
Various studies reviewed in the literature have developed software prediction models for estimating the prediction of software product including effort estimation, maintainability, defect proneness, and change proneness during the development lifecycle of the software. These software attributes are used to identify delicate parts of a software product and hence provide good practices to software project managers to examine the delicate parts of the software product. These practices help software project managers to assure the quality of software products.
The authors in [7] proposed an advanced technique in which NN-filter is embedded with genetic instance selection algorithm (GIS) and is applied on 41 Tera Promise Repository of cross project defect prediction (CPDP). To get the optimal solution and to remove noise from the labeling dataset, they applied the GIS approach. For the cleansing of dataset, feature-ranking phenomena is used by using iterative info-gain feature sub setting for feature selection. NN-filter is embedded in the model to create validation set in order to enhance the performance of the cross-project defect prediction (CPDP) by using cross validation. The base paper is defined in context of F1 and G measures which are used as a fitness function (F1*G) in GIS algorithm. The prediction is measured in terms of ROC, AUC, precision, recall, and F-measure. The results show that the performance of the classifier was enhanced by using such approaches. Thus, above research suggest that in case of high dimensional, data filters can improve prediction accuracy if applied before search-based algorithm. Feature Selection (FS) algorithms are proposed in [11,15] i.e., binary genetic algorithm (BGA), binary particle swarm optimization (BPSO), and binary ant colony optimization (BACO) to increase the optimization of software prediction models (SPMs). Nineteen real-world software projects from Tera PROMISE repository are used in this experiment. Layered recurrent neural network (L-RNN) is used as a classifier where feature selection (FS) approach is applied to increase the performance of L-RNN classifier to find software defect prediction problems. The data are split into test and training dataset by converting data into binary form i.e., 0 and 1. Training data are then passed through the classifier and results are cross validated. Results are measured through ROC and AUC metrics and are compared with classification algorithm i.e., artificial neural network (ANN), Naïve Bayes (NB), and decision tree (C4.5). Results show that the feature selection approach has high quality performance as compared with using all fixed features. They [16] explained that software defect prediction (SDP) is used to increase software dependability and test proficiency. Therefore, we need to clarify the features used in the software defect prediction, rather than those features that leads to poor performance of classifiers. However, class imbalance problem in software defect prediction has concerned the software industry and academia projects. They proposed a novel technique to solve class-imbalance using learning method for class imbalance problem both within-project and cross project. They applied stratification-embedded approach with nearest neighbor (STr-NN) to evolve training data with balanced data. They directly employed the stratification technique (STr-NN) for defect prediction in within project [6]. They first mitigate the class distribution between target dataset and source, then applied the STr-NN technique on the distributed data. They conducted experiment on NASA and PROMISE datasets. The implied results have higher precision, recall, and area under curve (AUC).
To optimize software resource allocation, SDP (software defect prediction) helps to optimize testing by generalizing defects before testing defect prone modules. Recent studies explicitly predicted defect-prone modules by using historical data for prediction. Though, one way of prediction of defects is by generalizing predictions from data of other projects. Software defect prediction is examined [17] by selection training data using 34 PROMISE datasets in context of cross project defect prediction (CPDP). By using cross project defect prediction, CPDP results are better by using training data from different projects as compared to the data used from similar projects. They employed five machine learning (ML) algorithms to construct prediction model, including support vector machine (SVM), Naïve Bayes (NB), J48, and decision tree (DT). The predictions are predicted by using recall, precision, and accuracy. Results for recall are greater than 70%, for precision greater than 50%, and for accuracy greater than 75%. As non-defective and defective features have imbalance class, therefore, achieving high precision for defect prediction is hard. Cross project defect prediction (CPDP) is necessary, as local data are used to predict defects. Data filters are required for the improvement of CPDP. The authors in [18] advised filter method for the 44 releases of 14 projects from Tera PROMISE data repository. Support vector machine (SVM) and Naïve Bayes (NB) are used as a classifier. TGF and DCBF are used as a filter technique that improves the results of the classifier. The results are measured through AUC.
The local models are used for defect prediction, and limitation of cross project defect prediction is describe by [1] as the main problem is heterogeneous data in cross project defect prediction (CPDP). They evaluate the pros and cons of cross project defect prediction (CPDP) by evaluating the performance of local models. They investigate both within-defect prediction (WDP) using same data and CPDP by transfer heterogeneous data. The results show that there is a minor difference in comparison between WDP and CPDP. They experimented on PROMISE data and showed that the results of support vector machine (SVM) are better than Naïve Bayes (NB) and C4.5 (decision tree) except random forest (RF) that has similar results as SVM. The results are measured using AUC and F-measure.
In another research [18], the authors proposed a boosting technique to balance the class for cross project defect prediction (CPDP). They applied combine learning algorithm SMOTE along with transfer cost-sensitive boost (TCSBoost) in order to reduce the cost of software prediction model. Experiment is carried out upon PROMISE datasets. They measure the results of Naïve Bayes classifier using F-measure and G-measure.
The authors in [19] presented an approach for software bug prediction in which genetic algorithm is used as a search-based algorithm. The feature is selected using the recombination of feature. The proposed methodology is validated on datasets of NASA and PROMISE repository. The results are compared using machine learning classification algorithms. These classification algorithms are decision tree (DT), Naïve Bayes (NB), and artificial neural network (ANN). The estimation process shows that the proposed approach has high accuracy rate and shows better performance. The proposed approach is measured through software quality attributes precision, recall, F-measure, and MMRE. Another feature selection (FS) technique is formalized in [20] using genetic algorithm and propose MOFES technique. They imply the multi-objective optimization problem and propose an advance technique, MOFES, which is then compared with the baseline approaches such as decision tree (DT), logistic regression (LR). The results show that the technique has better prediction performance by selecting less instances. The computational cost of software is acceptable. The results are cross-validated using k-fold. The AUC metric is used to measure the results.
A combined approach is proposed in [18] using feature selection and ensemble learning algorithm to predict performance of defect prediction. Average probability ensemble (APE) is applied along with SVM classifier to attain the performance of prediction model using NASA datasets that include MC1, PC2, and PC4. They used AUC measure to get the results.
Two multi-purpose approach is described in [9] for cross project defect prediction, first they minimize the misclassified feature cost and maximize the recall using comparing results using different classification algorithms, which includes random forest (RF), decision tree (C45), Naïve Bayes (NB), and logistic regression (LR). Second, they minimize the quality assurance activities from defect-prone projects. They run experiment using 41 multiple versions of Tera PROMISE Repository. Among different ML classification algorithms, logistic regression is highly cost effective than other algorithms which are used as single objective. The results are measured using recall and normalized misclassification cost.
The authors in [11,12,14] conducted experiment on NASA and PROMISE datasets and applied the feature subsets and feature ranking approaches in context of cross project defect prediction CPDP. They used K-nearest neighbor KNN and Naïve Bayes (NB) as a prediction algorithm. For feature selection, they used CFS and best-first search algorithm. They compared the results using AUC measures of all and CSF features sets.
Furthermore, the connectivity-based technique is explored in [21] on 26 public datasets of NASA, PROMISE, and AEEEM in order to overcome the heterogeneity problem of cross project defect prediction CPDP. They explored using five supervised (which includes decision tree, random forest, logistic regression, Naïve Bayes, and J48) and unsupervised algorithms (which includes K-mean clustering, C-mean, neural-gas, and spectral cluster technique). They measured the results using AUC, and found that unsupervised algorithms results are better than supervised algorithms.
The authors in [17] proposed a novel technique for cross projects named as multi transformation (MT+). They used BOX-COX transformation on AEEEM, NASA, and PROMISE datasets to define relevant training sets for cross projects. They compared the results of random forest (RF) with log transformation method. The results are measured by F-measure.
The multi-nomial classification technique is adopted in [22] for cross project defect prediction (CPDP) and within cross project defect prediction (WPDP). They applied random forest and gradient boosting method on PROMISE datasets as an ensemble-learning model. They defined their result using F-measure, AUC, and MAP. They labeled class information as class 0, class 1, and class 2. They identified that proper training data selection is necessary to optimize efficiency of defect prediction.
Authors [23] conducted and evaluated the combination of different filter methods on 16 high-dimensional datasets and used KNN as classifier. They compared the results of different combination of filter method to observe which combination gives the best result with respect to run time and stability aspects.
A novel technique is proposed in [21] for intrusion detection system based on feature selection and clustering algorithm. They used the filter and wrapper method for feature selection based on linear correlation coefficient (FGLCC) algorithm and cuttlefish algorithm (CFA) on KDD Cup 99 large dataset along with decision tree as classifier for proposed method. They achieved high accuracy of 95.03%.
To evaluate the impact of hybrid feature selection on PROMISE repository for cross project defect prediction, the authors proposed feature specific approach [24]. They used random forest and recursive feature elimination as hybrid feature selection along with NN classifier. They evaluated that feature selected through hybrid approach does have higher defect prediction accuracy of AUC 75.98%.

2.1. Gap Analysis

From the above study, we find that many researchers applied different methods including feature selection [7,11], filtering methods [16,17], ensemble techniques [2], classification algorithms [1,21], boosting and search-based optimizer [7,24]; Ref. [25] in order to overcome the heterogeneity of cross-project defect prediction (CPDP) [26]. There are several techniques applied in context of major issues of cross project defect prediction but researchers had not addressed the nature of dataset that how to clean data as public datasets have noise. All techniques are applied but still heterogeneity is the major problem in CPDP. This problem can be overcome by using multi-nominal classification using filters as data contain noise; therefore, we first rank and select relevant feature sets then apply search-based optimizer to optimize the defect prediction.

2.2. Research Questions

To achieve our goal, we focus on following research questions:
  • RQ1: What is the impact of feature selection for multi-class compared with binary class on cross-project defect prediction through F1 measure?
    • Null Hypothesis: Feature selection for multi-class compared with binary class has no impact on cross-project defect prediction through F1 measure.
    • Alternate Hypothesis: Feature selection for multi-class compared with binary class has an impact on cross-project defect prediction through F1 measure.
  • RQ2: What is the impact of ANN filter compared with KNN filter on cross-project defect prediction through F1-measure?
    • Null Hypothesis: ANN filter compared with KNN filter has no impact on cross-project defect prediction through F1-measure.
    • Alternate Hypothesis: ANN-filter compared with KNN-filter has an impact on cross-project defect prediction through F1-measure.
  • RQ3: What is the impact of search-based optimizer i.e., random forest ensemble compared with genetic algorithm, on cross-project defect prediction through F1-measure?
    • Null Hypothesis: Search-based optimizer i.e., random forest ensemble compared with Genetic Algorithm, has no impact on cross-project defect prediction through F1-measure.
    • Alternate Hypothesis: Search-based optimizer, i.e., random forest ensemble compared with genetic algorithm, has an impact on cross-project defect prediction through F1-measure.
  • RQ4: What is the impact of our classifier compared with Naïve Bayes classifier on cross-project defect prediction through F1-measure?
    • Null Hypothesis: Our classifier compared with Naïve Bayes classifier has no impact on cross-project defect prediction through F1-measure.
    • Alternate Hypothesis: Our classifier compared with Naïve Bayes classifier has an impact on cross-project defect prediction through F1-measure.

3. Research Methodology

This section defines the thorough facts of our experiment which we carry out. Let us discuss the content in detail.
The context of our research is cross project defect prediction. We predict the defects in cross project using machine learning algorithm. Our research type is explanatory which aims to explain the causes and consequences of a well-defined problem. The cross-project defect prediction is a well-defined problem, and we will find the defect prediction accuracy.

3.1. Data Collection

Our research is based on quantitative research methods to carry out the experiment. As quantitative research methods focus on numbers and statistics, our dataset is also of the same type. Objects of our study are source and target projects of PROMISE repository. In our research, we use different projects of promise repository as input to our model to train our classifier. Our research normalized our datasets before training our classifier (e.g., checking for noise removal, class imbalance, and handling distribution gap between source and target projects).

3.2. Research Method

Our research uses experimental research method to manipulate and control the variables in order to determine the cause and effect between variables for prediction accuracy and authenticity. The purpose of our experiment is optimum feature selection through search-based optimizer for cross project defect prediction. The perspective of our experiment is earlier defect prediction based on already developed mature projects. We will predict the defects earlier by training the classifier using mature source project and then predicting defects in the target projects. Our research has F1 measure as dependent variables. Our research has different independent variables for every research question. For Research question 1, our independent variable is KNN filter. For research question 2, our independent variables are KNN and ANN filter. For third research question, independent variables are random forest ensemble model and genetic algorithm. For last question, we have classifiers as independent variables.

3.3. Research Design

Our experiment design is different for every research question. Let us discuss the design for every question in detail.
  • RQ1: What is the impact of feature selection for multi-class compared with binary class on cross-project defect prediction through F1 measure? For this question, design is 1 factor and 1 treatment (1F1T) i.e., KNN-filter.
  • RQ2: What is the impact of ANN-filter compared with KNN-filter on cross-project defect prediction through F1-measure? For this question, design is 1 factor and 2 treatment (1F2T) i.e., KNN-filter and ANN-filter.
  • RQ3: What is the impact of search-based optimizer i.e., random forest ensemble compared with genetic algorithm, on cross-project defect prediction through F1-measure? For this question, design is 1 factor and 2 treatment (1F2T) i.e., random forest ensemble and genetic algorithm.
  • RQ4: What is the impact of our classifier compared with Naïve Bayes classifier on cross-project defect prediction through F1-measure? For this question, design is 1 factor and 2 treatment (1F2T) i.e., our classifier and Naïve Bayes classifier.

4. Proposed Methodology

In this section, we describe the model followed in our research. We conduct our experiment by performing the following visualized experiment (referred Figure 1):

4.1. Promise Repository

For the research, we used the PROMISE repository from year 2018. PROMISE is an open-source repository that is widely used for defect predictions studies. This dataset has 20 sets of features which are as follows (referred Table 1) [1]:

4.2. Exploratory Data Analysis

We explored and analyzed data on PROMISE repository to identify the missing and erroneous data by mapping and analyzing the structure of the data. EDA reveals that PROMISE repository is multi-class as shown in Figure 2 and has noise, class imbalance. The following figures show the variation in data and the presence of multi-class data in multiple versions of the project.
Our repository has noise in term of duplicated rows (referred to Figure 3) which are 709, 262, 718, 629, 648, and 308. We removed the noise from our PROMISE dataset, so that our trained model predicts the defects accurately with higher accuracy.
Our repository has an issue of distribution gap between source and target projects which diversely affect the prediction accuracy of the classifier. So, we removed the outliers from the datasets. The visualization for DIT feature of Camel and Ant is given in Figure 4 and Figure 5 respectively.

4.3. Data Preprocessing

In this section, we applied different techniques in order to normalize our data for further experimentation. Normalizing data means to remove all the issues which we identified in EDA of our repository. Our data contain numeric values in which different numbers represent the whole class data. The classes contain (0–62). Therefore, it is required to sort data so that we can distinguish the total number of classes. After sorting data, we clean the data, which leads to over-fitting of the model. Therefore, we remove the outliers which contain the data that are not required for training. Our dataset is unbalanced, which means it contains more samples for some classes compared to other datasets. Therefore, we balance our dataset before training our classifier in order to get equal number of samples in all our datasets. For balancing data, we use feature sampling.

4.4. Feature Ranking

Feature ranking is the procedure of selecting subset of significant instances in building software model. The significance of feature ranking is the generalization of models to make them easier to investigate by researchers and to avoid high dimensional data. By reducing over-fitting, feature ranking improves generalization. In our research, we use info-gain, a measure of the feature sub setting, which explains highest entropy in the data. The info-gain is formulated as:
HC = −cϵCpcp(c)
HA = −cϵAp(a)cϵCpap(c|a)
Using the info-gain approach, the features of the datasets are ranked from the highest to the lowest amount of entropy explained. The iterative Info-Gain is used to select subsets of applicable set of instances, computed by using top ranked attributes of training set. The predictor (j + 1) ranks these attributes continuously until all attributes are ranked for predictions. After feature ranking, we select the features and remove the redundant data from the feature subsets using info gain.

4.5. Feature Selection

We train and test three different sets of features for the base paper, which includes CK + LOC, the whole sets of features contain OO + SCM + LOC (all) and the third set contains IG (Info Gain) features which are extracted through iterative Info Gain sub setting technique using entropy. For CK + LOC, the base paper included features such as wmc, dit, noc, cbo, rfc, lcom, loc. For OO + SCM + LOC (all), base paper contains whole features that are defined in datasets. While IG features have, different sets of features for different versions of project that are given in Table 2.

4.6. Search Based Optimizer

The data are split into source and target datasets. The classifier is trained using source project and tested on the target project. After splitting the datasets into source and target projects, the source projects are fed into ANN-filter. The projects are fed into this filter in order to get the best possible feature sets. On getting the best sets of features, we give the sets to search-based optimizer i.e., random forest ensemble model and genetic algorithm as well for multi-class feature selection. We compare the results of both the techniques.
In the last step, we classify our results into multi-class by applying the trained model on the target projects and compared our results with the base paper classifier. In this section, we explain results of our all-research questions one by one and then we analyze them in detail.
RQ1: What is the impact of feature selection for multi-class compared with binary class on cross project defect prediction through F1 measure?
We used 41 datasets of Tera PROMISE Repository for our research experiment. The datasets have multi-class problem but most of the research are carried out on these datasets by using binary class. Therefore, we analyzed and compared the results by carrying out experiments for both binary and multi-class through KNN and then we compared our results with the base paper. Through results given in Table 3, we describe and explain the reasons to use multi-class data for the research experiment.
By comparing the multi-class and binary class results with the base paper OO + SCM + LOC (all), CKLOC, IG, in Table 3, it is seemed that the multi-class F1-measures are significantly better than binary class F1-measures. The dataset Xerces-1.3 has high F1-measure, which is 0.92 for base paper OO + SCM + LOC (all) for multi-class-KNN, whereas for binary-KNN has a value of 0.33. Similarly, Ivy-2.0 has more F1-score for multi-class-KNN (all) than binary-KNN (all) which has 0.36 F1-score. These results are present in Table 3. Whereas Lucene-2.4 has the lowest value, 0.29 for multi-class-KNN as compared to binary-KNN, which has 0.35. Overall results are significantly improved by 40% to 60% using multi-class for KNN algorithm for the base paper set for the research experiment.
RQ2: What is the impact of ANN filter compared with KNN filter on cross project defect prediction through F1-measure?
Datasets are imported using sklearn library in python after preprocessing of data, and the data are fed into ANN-filter. Using ANN (artificial neural network) algorithm, we filter out the data to select the most relevant features. ANN is used in different ways such as MLP (multi-layer perceptron), SLP (single layer perceptron), and RBF (radial basis function). For our experiment, we use MLP, as we have multi-class problem. Therefore, we compare our results with the base paper shown below in Table 4.
There is a combination of neurons (more linear layers) in MLP (multi-layer perceptron). Usually there are three layers in the three-layer network of neuron. Input layer is the first layer, hidden layer is the middle layer, and output layer is the last layer. We feed data into input layer and get output from output layer. The number of hidden layers can increase as much as it is required for training data.
To train MLP model, we use solver “ibfgs” where two hidden layers are used in which 50 and 5 weights are assign to them. We give maximum 1000 iterations to the model where random state = 0. The results of this model are shown in Table 4. The following Table 4 shows the results of ANN filter and KNN filter for multi-class. The results are compared with the base paper OO + SCM + LOC (all), CK + LOC (ckloc), and Info Gain (IG) using F1-score.
Xerces-1.4 has higher F1-score (99.1%) for the base paper (all) for ANN-filter, whereas Xerces 1.4 has (74%) F1-score for KNN filter. Log4j 1.2 has least F1-score (85.7%) for the base paper (all) for ANN-filter while Log4j-1.2 has (35%) F1-score for KNN-filter. The results are improved more than 45%.
The results of ANN filter (ckloc) and KNN filter (ckloc) show that the results of projects including camel-1.4, xalan-2.5, xalan-2.4, Jedit 4.3, and ivy-2.0 have high F1-measure for ANN filter (0.992, 0.990, 0.989, 0.988, and 0.986) compared to KNN filter (0.83, 0.56, 0.85, 0.72, and 0.88) respectively. Where ant 1.3 has the lowest F1-measure for ANN filter of 0.571 compare with KNN filter which is 0.897 using multi-class.
The results of ANN filter (IG) and KNN filter (IG) show that the results of projects including synapse-1.0, poi-3.0, xerces-1.4, ant-1.7, and ivy 1.4 have high F1-measure for ANN filter (0.97, 0.952, 0.947, 0.923, and 0.920) comparing to KNN filter (0.84, 0.64, 0.68, 0.75, and 0.88) respectively. Where lucene-2.0 has the lowest F1-measure for ANN filter of 0.18 compare with KNN filter, which is 0.51 using multi-class IG feature sets.
RQ3: What is the impact of search-based optimizer i.e., random forest ensemble compared with base paper genetic algorithm, on cross project defect prediction through F1-measure?
We applied the random forest ensemble as a search-based optimizer for multi-class feature sets. The results are shown in Table 5; we compared the results of search-based optimizer random forest ensemble (RFE) with genetic algorithm (GA) using base paper SCM + OO + LOC (all), CK + LOC (ckloc), and IG features.
From Table 5, it is shown the results random forest ensemble (all) including projects (poi-2.5, poi-3.0, xerces-1.4, and ant-1.5) have high F1-measure which is 0.99, 0.98, 0.980, and 0.97 respectively comparing with genetic algorithm which has values of 0.769, 0.767, 0.665, 0.13 respectively. Where log4j-1.2 has the lowest F1-measure for RFE (all) of 0.67 compare with GA (all), which is 0.746 using multi-class IG feature sets.
It is shown that the results of random forest ensemble (ckloc) including projects (lucene-2.2, poi-2.5, poi-3.0, xerces-1.4, and ant-1.5) have high F1-measure which is 0.99, 0.98, 0.980, and 0.97 respectively comparing with genetic algorithm which has values (0.769, 0.767, 0.665, 0.13 respectively). Where log4j-1.2 has the lowest F1-measure for RFE (all) of 0.67 compared with GA (all), which is 0.746 using multi-class IG feature sets.
The results of random forest ensemble (IG) including projects (lucene-2.2, poi-2.5, poi-3.0, xerces-1.4, and ant-1.5) show high F1-measure which is 0.99, 0.98, 0.980, and 0.97 respectively, comparing with genetic algorithm which has values 0.769, 0.767, 0.665, 0.13 respectively. Where log4j-1.2 has the lowest F1-measure for RFE (IG) that has 0.67 compare with GA (IG), which is 0.746 using multi-class IG feature sets.
The results of multi-class random forest ensemble (RFE) and genetic algorithm (GA) for IG features, which are significantly, improve 30% to 50%. In addition, results are also compromised using random forest ensemble (RFE) including ant-1.3, Poi-1.5, xalan-2.7, velocity-1.6, Xerces-init, and jedit-3.5.
RQ4: What is the impact of our classifier compared with Naïve Bayes classifier on cross project defect prediction through F1-measure?
In this approach, the complete training set fed into the learner and the model is trained with all the training data points. For the prediction measure, we use a classifier. Table 6 illustrates the classifier by comparing with Naïve Bayes benchmark classifier SCM + OO + LOC (all), CK + LOC (ckloc), and IG using F1-measure.
From Table 6, it is shown that the results of classifier (all) including projects (lucene-2.2, poi-2.5, poi-3.0, xerces-1.4, and ant-1.5) have Naïve Bayes algorithm that has values (0.769, 0.767, 0.665, and 0.13 respectively). Where log4j-1.2 has the lowest F1-measure for RFE (all) of 0.67 compare with GA (all), which is 0.746 using multi-class IG feature sets.
The results of classifier (ckloc) including projects (lucene-2.2, poi-2.5, poi-3.0, xerces-1.4, and ant-1.5) have Naïve Bayes algorithm that has values (0.769, 0.767, 0.665, and 0.13 respectively). Where log4j-1.2 has the lowest F1-measure for RFE (all) of 0.67 compared with GA (all), which is 0.746 using multi-class ckloc feature sets.
Some results are substantially improved and some results are compromised using IG features for software defect prediction. These projects include Jedit-3.5, Xalan-init, Xalan-2.6, Lucene 2.0, Ant-1.4, and Xalan-2.5 which have lower values compared with Naïve Bayes using IG features. The mean values of F1-measure were derived for the experiment using algorithms. From the experiment, we measure F1 to predict the performance of algorithms. The error bar shows the linearity between the results. The results measured for the experiment are shown by using Box Plot as shown in Figure 6.
The above box-plot clearly explains the results of all the algorithms used in our experiment i.e., ANN filter, classifiers, and feature selection technique through F1 measure. The figure illustrates the mean values of F1-measure conducted for the experiment using algorithms. From the experiment, we measure the F1 to predict the performance of algorithms. The error bar shows the linearity between the results.

5. Research Validation

In this section, we describe the validity of our research through statistical tests i.e., Cohen’s D, Glass’s Delta and Hedges’ G, and Wilcoxon test. Let us review the results in detail.

5.1. Cohen’s D

Cohen’s d is calculated for the individual T test samples by measuring the mean variance of two sets and then dividing the estimate by the combined standard deviation.
Cohen’s d = (M2 − M1)/SDpooled
where:
SDpooled = µ ((SD12 + SD22)/2)

5.2. Glass’s Delta and Hedges’ G

Cohen’s d is an effective of effective size if two classes have similar standard deviations and are of the equal size. Glass’s delta, which utilizes only the control group’s standard deviation, is an additional indicator when each group has a different standard deviation. Hedges’ g, which gives a weighted estimate of the effect size by the relative size of each study, is an alternative having dissimilar sample sizes.

5.3. Wilcoxon Test

The following null and alternative hypotheses need to be tested:
H0. 
Median (Difference) ≤ 0.
H1. 
Median (Difference) > 0.
Observe that the sample size n = 41 > 30 is large enough to use normal approximation, so a z-statistic will be used. The significance level, based on the information provided is alpha = 0.05, and the critical value for a right-tailed test is Zc = 1.64. The rejection region for this right-tailed test is R = {z:z > 1.64} R = z:z > 1.64. The z-statistic is computed as follows
z = T − n (n + 1)/4nn + 12n + 1/(24)
The given table shows the test results using Cohen’s d, Glass’s delta, and Hedge’s g results.
The given table shows the test results using Wilcoxon signed rank test results.

5.4. Analysis of Validation Test

The results of validation test shown in Table 7 using Cohen’s d, Glass’s delta, and Hedges’ g test for the research experiment to validate the experiment conducted for the experiment. For multi-class KNN filter (all, ckloc, IG) base paper, we have z-value = (−5.501, −5.579, −5.579), Cohen’s d = (2.537, 3.180, 2.846), p-value = (1.00, 1.00, 1.00), which are greater than α = 0.05. For the ANN filter (all, ckloc, IG) base paper, we get p-value (1.00, 1.00, 0.627), Cohen’s d = (2.232, 2.111, 0.064), and z-value (−5.579, −5.216, −0.324). For the validation test results of search-based optimizer RFE (all, ckloc, IG) we have p-value = (0.00261, 0.00564, 0.00013), Cohen’s d = (3.432, 2.868, 0.586), and z value = (−5.566, −5.566, −2.287). The validation results of our classifier (all, ckloc, IG) base paper, we get p-value = (1.00, 1.00, 0.992), Cohen’s d = (4.874, 5.302, 0.811), and z-value is (−5.579, −5.579, −3.155). It is concluded that it rejects the null H0 hypothesis. There is also insufficient evidence to say that the population mean of variations is greater than zero at the significance level of alpha = 0. 05α = 0.05. For validation test of our paper, we carry out the Wilcoxon signed rank test for filters, optimizer, and classifiers. We get the p-value for KNN vs. ANN filter (all, ckloc) to be (0.00364, 0.00217), p-value for RFE vs. GA (all, ckloc, IG) to be (0.00261, 0.00564, 0.00013), and p-value for classifiers vs. NB (ckloc, IG) to be (0.00024, 0.00128). It is concluded that it rejects the null H0 hypothesis which validates our results (referred to Table 7 and Table 8).

6. Threats to Validity

Throughout an empirical study, one should be responsive of the possible threats to the legitimacy of the obtained results and findings that are derived from the experiment. The possible threats to the validity recognized for this research are evaluated in two categories, namely: construct, external and conclusion validity.

6.1. Construct Validity

In this experiment, SCM, OO, and LOC are the only metrics used from the datasets. These measures were commonly used in previous studies. Although these metrics can achieve good performance, but the usefulness of this metrics has been widely criticized. There are still some errors that might exist in non-defective labels as not all the defects were detected. This could be a potential threat to preparation and assessment of defect prediction models. Moreover, we have not checked for different values of iterations in ANN filter. We only chose specific elements for large datasets. Based on 1000 iterations, one might notice performance changes in terms of prediction.

6.2. External Validity

Our experiment is restricted to the evidence and background studies, therefore, specific findings from research are difficult to draw. All the projects that lead to our research are written in JAVA and that would certainly affect the generalization of our results. Although many studies have used subsets of our used databases as the foundation for their results, there is no guarantee that conclusions drawn from those ventures will be generalized. Mainly the applicability of the findings to industrial and closed source applications could be specific as there are typically more strict levels of code quality involved with such initiatives.

6.3. Conclusion Validity

Wilcoxon signed rank test need more post hoc examination to classify the localities of variations observed in multiple groups. We carry out Wilcoxon experiments in pairs to find possible differences of comparisons for different versions and other CPDPs. Additionally, Cohen’s d for similar studies was used as effect size to measure the extent of the discrepancies. Another challenge is the lack of test of assessment. Certain studies may consider different steps to test the methodology and some of the findings and results might alter as a result. While our method works well for a large portion of the datasets (as opposed to CPDP base papers), it is not necessarily better for all of them, and further investigation is needed.

7. Conclusions

As per our research analysis, the optimizer and classifier are dependent upon the nature of the classes of data i.e., multi or binary. The base paper treated the cross-project defect repository of Tera PROMISE as binary class data whereas through EDA, it is revealed that data are multi-class in nature. There was variation in the features selected in our experiment through info-gain and selected in base paper. We then applied the same filter using multi-class data and obtained significant results. However, ANN filter still has more significant results as compared with the KNN filter. We then used RFE as a search-based optimizer and get better results than the given base paper. We used a classifier for our multi class dataset and our results improved by 30% as compared with base paper. The results are significantly improved by 40% to 60% using filters and we analyzed those results are also improved using multi-class. Our proposed method outperforms for the base paper of CPDP using multi-class. It seems that using ckloc features the results are high as compared with IG and all features. There is huge variation in results using IG features therefore, it is not recommended for future studies. We can use ckloc features for further investigation to improve the quality and performance of data collection in preparation. The success of our selection method will be affected by the amount of training sets for candidates. We intend to examine further possible determinants for effective cross-project detection of defects and to establish more reliable and accurate methods for selecting data for testing. In future, we can predict as categorical class for the base paper of CPDP, which is ultimately advantageous to predict defects on early basis. The cost and resources will be less using this approach and training sets will be available for further analysis.

Author Contributions

Conceptualization, R.b.F., S.S., M.S. and H.T.R.; Methodology, R.b.F. and S.S.; Software, R.b.F. and S.S.; Validation, H.T.R.; Formal analysis, R.b.F.; Investigation, M.S.; Resources, H.T.R.; Data curation, S.S.; Writing—original draft, R.b.F., S.S. and M.S.; Writing—review & editing, R.b.F., S.S., M.S. and H.T.R.; Visualization, R.b.F., S.S., M.S. and H.T.R.; Supervision, H.T.R.; Funding acquisition, M.S. All authors have read and agreed to the published version of the manuscript.

Funding

The authors extend their appreciation to King Saud University, Saudi Arabia, for funding this work through Researchers Supporting Project number (RSPD2023R704), King Saud University, Riyadh, Saudi Arabia.

Data Availability Statement

Data sharing is not applicable—no new data are generated.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Herbold, S.; Trautsch, A.; Grabowski, J. Global vs. local models for cross project defect prediction: A replication study. Empir. Softw. Eng. 2017, 22, 1866–1902. [Google Scholar] [CrossRef]
  2. Zimmermann, T.; Nagappan, N.; Gall, H.; Giger, E.; Murphy, B. Cross project defect prediction: A large scale experiment on data vs. domain vs. process. In Proceedings of the 7th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, Amsterdam, The Netherlands, 24–28 August 2009; pp. 91–100. [Google Scholar] [CrossRef] [Green Version]
  3. Basili, R.V.; Briand, L.; Melo, L.W. A validation of object-oriented design metrics as quality indicators. IEEE Trans. Softw. Eng. 1996, 22, 751–761. [Google Scholar] [CrossRef] [Green Version]
  4. Yu, Q.; Qian, J.; Jiang, S.; Wu, Z.; Zhang, G. An Empirical Study on the Effectiveness of Feature Selection for Cross Project Defect Prediction. IEEE Access 2019, 7, 35710–35718. [Google Scholar] [CrossRef]
  5. Moser, R.; Pedrycz, W.; Succi, G. A Comparative analysis of the efficiency of change metrics and static code attributes for defect prediction. In Proceedings of the 30th International Conference on Software Engineering, Leipzig, Germany, 10–18 May 2008; pp. 181–190. [Google Scholar] [CrossRef] [Green Version]
  6. Ostrand, T.J.; Weyuker, E.J.; Bell, R.M. Predicting the location and number of faults in large software systems. IEEE Trans. Softw. Eng. 2005, 31, 340–355. [Google Scholar] [CrossRef]
  7. Hosseini, S.; Turhan, B.; Mäntylä, M. A benchmark study on the effectiveness of search-based data selection and feature selection for cross project defect prediction. Inf. Softw. Technol. 2018, 95, 296–312. [Google Scholar] [CrossRef] [Green Version]
  8. Ryu, D.; Jang, J.I.; Baik, J. A transfer cost-sensitive boosting approach for cross-project defect prediction. Softw. Qual. J. 2017, 25, 235–272. [Google Scholar] [CrossRef]
  9. Shukla, S.; Radhakrishnan, T.; Muthukumaran, K.; Neti, L.B.M. Multi-objective cross-version defect prediction. Soft Comput. 2018, 22, 1959–1980. [Google Scholar] [CrossRef]
  10. Zhang, F.; Zheng, Q.; Zou, Y.; Hassan, A.E. Cross-project defect prediction using a connectivity-based unsupervised classifier. In Proceedings of the IEEE/ACM 38th International Conference on Software Engineering (ICSE), Austin, TX, USA, 14–22 May 2016; pp. 309–320. [Google Scholar] [CrossRef]
  11. Turabieh, H.; Mafarja, M.; Li, X. Iterated feature selection algorithms with layered recurrent neural network for software fault prediction. Expert Syst. Appl. 2019, 122, 27–42. [Google Scholar] [CrossRef]
  12. Cheikhi, L.; Abran, A. Promise and ISBSG Software Engineering Data Repositories: A Survey. In Proceedings of the 2013 Joint Conference of the 23rd International Workshop on Software Measurement and the 8th International Conference on Software Process and Product Measurement, Ankara, Turkey, 23–26 October 2013; pp. 17–24. [Google Scholar] [CrossRef]
  13. Zhang, F.; Keivanloo, I.; Zou, Y. Data Transformation in Cross-project Defect Prediction. Empir. Softw. Eng. 2018, 22, 3186–3218. [Google Scholar] [CrossRef]
  14. Wu, F. Empirical validation of object-oriented metrics on NASA for fault prediction. Commun. Comput. Inf. Sci. 2011, 201, 168–175. [Google Scholar] [CrossRef]
  15. Turhan, B.; Menzies, T.; Bener, A.B.; Stefano, J.D. On the relative value of cross-company and within-company data for defect prediction. Empir. Softw. Eng. 2009, 14, 540–578. [Google Scholar] [CrossRef] [Green Version]
  16. Gong, L.; Jiang, S.; Bo, L.; Jiang, L.; Qian, J. A Novel Class-Imbalance Learning Approach for Both Within-Project and Cross Project Defect Prediction. IEEE Trans. Reliab. 2020, 69, 40–54. [Google Scholar] [CrossRef]
  17. Li, Y.; Huang, Z.; Wang, Y.; Fang, B. Evaluating data filter on cross-project defect prediction: Comparison and improvements. IEEE Access 2017, 5, 25646–25656. [Google Scholar] [CrossRef]
  18. Laradji, I.H.; Alshayeb, M.; Ghouti, L. Software defect prediction using ensemble learning on selected features. Inf. Softw. Technol. 2015, 58, 388–402. [Google Scholar] [CrossRef]
  19. Hammouri, A.; Hammad, M.; Alnabhan, M.; Alsarayrah, F. Software Bug Prediction using machine learning approach. Int. J. Adv. Comput. Sci. Appl. 2018, 9, 78–83. [Google Scholar] [CrossRef] [Green Version]
  20. Chen, X.; Shen, Y.; Cui, Z.; Ju, X. Applying Feature Selection to Software Defect Prediction Using Multi-Objective Optimization. In Proceedings of the IEEE 41st Annual Computer Software and Applications Conference (COMPSAC), Turin, Italy, 4–8 July 2017; Volume 2, pp. 54–59. [Google Scholar] [CrossRef]
  21. Mohammadi, S.; Mirvaziri, H.; Ghazizadeh-Ahsaee, M.; Karimipourb, H. Cyber intrusion detection by combined feature selection algorithm. J. Inf. Secur. Appl. 2019, 44, 80–88. [Google Scholar] [CrossRef]
  22. Goel, L.; Sharma, M.; Khatri, S.; Damodaran, D. Prediction of Cross Project Defects using Ensemble based Multinomial Classifier. EAI Endorsed Trans. Scalable Inf. Syst. 2019, 7, e5. [Google Scholar] [CrossRef]
  23. Bommert, A.; Sun, X.; Bischl, B.; Rahnenführer, J.; Lang, M. Benchmark for filter methods for feature selection in high-dimensional classification data. Comput. Stat. Data Anal. 2020, 143, 106839. [Google Scholar] [CrossRef]
  24. Jalil, A.; Faiz, R.B.; Alyahya, S.; Maddeh, M. Impact of Optimal Feature Selection Using Hybrid Method for a Multiclass Problem in Cross Project Defect Prediction. Appl. Sci. 2022, 12, 12167. [Google Scholar] [CrossRef]
  25. He, Z.; Shu, F.; Yang, Y.; Li, M.; Wang, Q. An investigation on the feasibility of cross-project defect prediction. Autom. Softw. Eng. 2012, 19, 167–199. [Google Scholar] [CrossRef]
  26. Giray, G.; Bennin, K.E.; Köksal, Ö.; Babur, Ö.; Tekinerdogan, B. On the use of deep learning in software defect prediction. J. Syst. Softw. 2023, 195, 111537. [Google Scholar] [CrossRef]
Figure 1. Proposed methodology.
Figure 1. Proposed methodology.
Electronics 12 00514 g001
Figure 2. Multi-class of Xerces-1.4.
Figure 2. Multi-class of Xerces-1.4.
Electronics 12 00514 g002
Figure 3. Noise as duplicated rows in data.
Figure 3. Noise as duplicated rows in data.
Electronics 12 00514 g003
Figure 4. DIT feature of Camel. Dots circled in red represents the outliers.
Figure 4. DIT feature of Camel. Dots circled in red represents the outliers.
Electronics 12 00514 g004
Figure 5. DIT feature of Ant. Dots circled in red represents the outliers.
Figure 5. DIT feature of Ant. Dots circled in red represents the outliers.
Electronics 12 00514 g005
Figure 6. Box plot of F-measure for algorithm used for CPDP.
Figure 6. Box plot of F-measure for algorithm used for CPDP.
Electronics 12 00514 g006
Table 1. Promise repository features.
Table 1. Promise repository features.
SR #AttributeAbbreviationsDescription
1WMCWeighted Methods per classThe number of methods used in a given class
2DITDepth of Inheritance TreeThe maximum distance from a given class to the root of an inheritance tree
3NOCNumber of ChildrenThe number of children of a given class in an inheritance tree
4CBOCoupling between Object ClassesThe number of classes that are coupled to a given class
5RFCResponse for a ClassThe number of distinct methods invoked by code in a given class
6LCOMLack of Cohesion in MethodsThe number of method pairs in a class that do not share access to any class attributes
7CAAfferent CouplingAfferent coupling, which measures the number of classes that depends upon a given class
8CEEfferent CouplingEfferent coupling, which measures the number of classes that a given class depends upon
9NPMNumber of Public Methodsthe number of public methods in a given class
10LCOM3Normalized Version of LCOMAnother type of lcom metric proposed by Henderson-Sellers
11LOCLines of CodeThe number of lines of code in a given class
12DAMData Access MetricThe ratio of the number of private/protected attributes to the total number of attributes in a given class
13MOAMeasure of AggregationThe number of attributes in a given class which are of user-defined types
14MFAMeasure of Functional AbstractionThe number of methods inherited by a given class divided by the total number of methods that can be accessed by the member methods of the given class
15CAMCohesion among MethodsThe ratio of the sum of the number of different parameter types of every method in a given class to the product of the number of methods in the given class and the number of different method parameter types in the whole class
16ICInheritance CouplingThe number of parent classes that a given class is coupled to
17CBMCoupling Between MethodsThe total number of new or overwritten methods that all inherited methods in a given class are coupled to
18AMCAverage Method ComplexityThe average size of methods in a given class
19MAX_CCMaximum Values of Methods in the same ClassThe maximum McCabe’s cyclomatic complexity (CC) score of methods in a given class
20AVG_CCMean Values of Methods in the same classThe arithmetic means of the McCabe’s cyclomatic complexity (CC) scores of methods in a given class
Table 2. Info gain features of datasets.
Table 2. Info gain features of datasets.
SR #DatasetsInfo Gain Features
1Ant-1.3rfc, ca, lcom3, cam, avg_cc
2Ant-1.4ce, loc, moa
3Ant-1.5wmc, cbo, rfc, ce, cbm
4Ant-1.6rfc, lcom3, cam, cbm, amc, avg_cc
5Ant-1.7cbo, ce, loc, cbm, amc, avg_cc
6Camel-1.0cbo, lcom, ca, npm, mfa
7Camel-1.2ca, ce, npm, mfa, cbm
8Camel-1.4rfc, ce, lcom3, loc, mfa, avg_cc
9Camel-1.6dit, lcom, ca, ce, amc, max_cc
10Ivy-1.1lcom, ca, amc, max_cc
11Ivy-1.4ca, ce, lcom3, loc, cam
12Ivy-2.0cbo, lcom, npm, ic, max_cc
13Jedit-3.5cbo, rfc, ca, ce, moa, max_cc
14Jedit-4.0lcom, ca, locm3, loc, moa, cam
15Jedit-4.1rfc, loc, amc, avg_cc
16Jedit-4.2rfc, npm, dam, mfa
17Jedit-4.3ca, ce, npm, loc, moa
18Log4j-1.0lcom, npm, loc, moa
19Log4j-1.1wmc, cbo, loc, mfa
20Log4j-1.2rfc, ca, npm, mfa, ic, cbm, amc
21Lucene-2.0noc, rfc, moa, mfa, cam, amc
22Lucene-2.2ca, npm, lcom3, loc, moa, amc
23Lucene-2.4rfc, ca, ce, lcom3, dam, amc
24Poi-1.5cbo, rfc, lcom3, loc, cam
25Poi-2.0wmc, cbo, lcom, loc, mfa, amc, max_cc
26Poi-2.5loc, dam, cam, cbm, amc
27Poi-3.0cbo, ce, lcom3, cbm, amc, avg_cc
28Synapse-1.0dit, rfc, lcom3, mfa, cam
29Synapse-1.1cbo, rfc, ca, npm, mfa, avg_cc
30Synapse-1.2rfc, lcom, loc, cbm, amc, avg_cc
31Velocity-1.4dit, ce, cam, amc, max_cc
32Velocity-1.5noc, lcom, loc, mfa, cam
33Velocity-1.6cbo, lcom3, mfa, cam, amc, avg_cc
34Xalan-2.4cbo, rfc, ca, loc, amc
35Xalan-2.5lcom, loc, cam, cbm
36Xalan-2.6rfc, loc, mfa, amc, max_cc
37Xalan-2.7rfc, loc, mfa, amc, max_cc
38Xerces-1.2noc, cbo, rfc, npm, moa, cam
39Xerces-1.3cbo, ca, loc, dam, moa
40Xerces-1.4cbo, ca, ce, loc, mfa, avg_cc
41Xerces-initwmc, cbo, loc, dam, moa, amc, avg_cc
Table 3. Multi-class vs binary class of dataset.
Table 3. Multi-class vs binary class of dataset.
Multi-ClassBinary-Class
SR #DatasetsANN (Artificial Neural Network) FilterKNN (K-Nearest Neighbor) Filter
ALLCKLOCIGALLCKLOCIG
1Ant-1.30.880.890.870.370.440.48
2Ant-1.40.660.680.700.210.180.27
3Ant-1.50.870.850.860.310.440.33
4Ant-1.60.670.710.670.410.420.45
5Ant-1.70.750.760.750.490.420.48
6Camel-1.00.740.660.940.180.230.12
7Camel-1.20.590.580.580.270.230.24
8Camel-1.40.810.830.820.280.230.26
9Camel-1.60.790.780.790.210.210.22
10Ivy-1.10.600.650.430.370.220.22
11Ivy-1.40.890.880.880.310.120.18
12Ivy-2.00.910.880.880.360.430.41
13Jedit-3.50.780.750.680.330.220.30
14Jedit-4.00.790.800.790.420.300.36
15Jedit-4.10.830.870.810.490.410.40
16Jedit-4.20.890.890.870.440.370.42
17Jedit-4.30.670.720.970.090.160.15
18Log4j-1.00.590.600.670.510.390.34
19Log4j-1.10.550.580.550.570.500.46
20Log4j-1.20.350.430.420.210.130.16
21Lucene-2.00.500.460.510.440.320.38
22Lucene-2.20.380.360.360.280.220.23
23Lucene-2.40.290.370.380.350.210.25
24Poi-1.50.750.780.680.310.210.21
25Poi-2.00.850.840.850.260.190.23
26Poi-2.50.650.640.530.230.160.17
27Poi-3.00.660.630.640.260.180.19
28Synapse-1.00.780.790.840.420.310.41
29Synapse-1.10.630.640.630.460.310.44
30Synapse-1.20.570.550.570.560.310.43
31Velocity-1.40.490.460.470.180.080.13
32Velocity-1.50.540.510.510.220.110.18
33Velocity-1.60.600.630.660.290.200.31
34Xalan-2.40.850.850.840.390.310.34
35Xalan-2.50.610.560.580.370.300.300
36Xalan-2.60.670.620.610.510.400.41
37Xalan-2.70.820.810.810.400.240.25
38Xerces-1.20.800.820.790.240.170.20
39Xerces-1.30.920.930.910.330.290.28
40Xerces-1.40.740.730.680.310.180.19
41Xerces-init0.550.560.550.310.250.27
Mean0.6892680.6910980.691220.3443410.2730240.29778
Median0.670.710.680.3310.2390.277
Table 4. ANN vs. KNN result of datasets.
Table 4. ANN vs. KNN result of datasets.
Multi-Class
SR #DatasetsANN (Artificial Neural Network) FilterKNN (K-Nearest Neighbor) Filter
ALLCKLOCIGALLCKLOCIG
1Ant-1.30.950.570.500.880.890.87
2Ant-1.40.940.850.330.660.680.70
3Ant-1.50.930.900.750.870.850.86
4Ant-1.60.920.940.720.670.710.67
5Ant-1.70.990.970.920.750.760.75
6Camel-1.00.930.960.850.740.660.94
7Camel-1.20.970.920.530.590.580.58
8Camel-1.40.970.990.680.810.830.82
9Camel-1.60.970.980.830.790.780.79
10Ivy-1.10.900.830.710.600.650.43
11Ivy-1.40.930.950.920.890.880.88
12Ivy-2.00.970.980.920.910.880.88
13Jedit-3.50.880.960.490.780.750.68
14Jedit-4.00.860.910.880.790.800.79
15Jedit-4.10.900.960.900.830.870.81
16Jedit-4.20.960.960.570.890.890.87
17Jedit-4.30.970.980.870.670.720.97
18Log4j-1.00.920.960.620.590.600.67
19Log4j-1.10.900.950.570.550.580.55
20Log4j-1.20.850.950.330.350.430.42
21Lucene-2.00.920.900.180.500.460.51
22Lucene-2.20.930.960.500.380.360.36
23Lucene-2.40.960.980.590.290.370.38
24Poi-1.50.960.960.230.750.780.68
25Poi-2.00.970.960.850.850.840.85
26Poi-2.50.950.950.310.650.640.53
27Poi-3.00.910.930.950.660.630.64
28Synapse-1.00.890.960.970.780.790.84
29Synapse-1.10.900.950.530.630.640.63
30Synapse-1.20.980.980.540.570.550.57
31Velocity-1.40.970.960.710.490.460.47
32Velocity-1.50.960.960.330.540.510.50
33Velocity-1.60.970.870.500.600.630.66
34Xalan-2.40.930.980.850.850.850.84
35Xalan-2.50.980.990.880.610.560.58
36Xalan-2.60.970.980.900.670.620.61
37Xalan-2.70.980.980.800.820.810.81
38Xerces-1.20.980.890.800.800.820.79
39Xerces-1.30.940.970.890.920.930.91
40Xerces-1.40.990.970.940.740.730.68
41Xerces-init0.870.940.580.550.560.55
Mean0.9437320.9427070.6785370.6892680.6910980.69122
Median0.950.960.7140.670.710.68
Table 5. RFE vs. GA result of datasets.
Table 5. RFE vs. GA result of datasets.
SR #DatasetsRandom Forest Ensemble (RFE)Genetic Algorithm (GA)
ALLCKLOCIGALLCKLOCIG
1Ant-1.30.880.800.540.380.430.41
2Ant-1.40.880.780.590.440.390.41
3Ant-1.50.970.600.720.310.350.35
4Ant-1.60.920.860.690.500.520.55
5Ant-1.70.960.900.900.450.480.50
6Camel-1.00.960.930.580.200.190.20
7Camel-1.20.960.900.780.520.580.51
8Camel-1.40.910.930.570.390.410.38
9Camel-1.60.950.950.520.400.440.38
10Ivy-1.10.840.600.840.660.700.60
11Ivy-1.40.940.930.780.240.270.27
12Ivy-2.00.950.930.530.360.310.41
13Jedit-3.50.870.900.180.560.610.60
14Jedit-4.00.890.880.650.460.500.51
15Jedit-4.10.890.830.530.520.520.56
16Jedit-4.20.920.850.730.380.360.43
17Jedit-4.30.890.880.840.110.090.12
18Log4j-1.00.850.840.850.490.560.51
19Log4j-1.10.900.950.850.580.630.61
20Log4j-1.20.670.930.480.740.690.79
21Lucene-2.00.910.970.290.630.650.61
22Lucene-2.20.960.980.690.640.680.61
23Lucene-2.40.960.970.760.690.710.66
24Poi-1.50.880.880.400.680.700.74
25Poi-2.00.930.970.800.280.310.32
26Poi-2.50.990.980.550.760.760.80
27Poi-3.00.980.980.900.760.800.79
28Synapse-1.00.950.910.970.290.330.34
29Synapse-1.10.940.960.600.460.520.51
30Synapse-1.20.970.980.580.550.570.57
31Velocity-1.40.920.910.750.570.640.72
32Velocity-1.50.950.940.640.630.600.71
33Velocity-1.60.900.940.270.510.530.56
34Xalan-2.40.910.950.840.390.380.40
35Xalan-2.50.920.920.200.570.590.58
36Xalan-2.60.890.920.310.520.580.59
37Xalan-2.70.930.950.310.810.840.78
38Xerces-1.20.920.940.770.240.270.28
39Xerces-1.30.970.970.880.420.350.40
40Xerces-1.40.980.930.840.660.650.71
41Xerces-init0.890.890.520.400.430.51
Mean0.9182930.9027800.6346340.4958780.5150.524073
Median0.920.930.650.5070.5290.519
Table 6. Result of our classifier.
Table 6. Result of our classifier.
SR #DatasetsOur ClassifierBenchmark Classifier (NB)
ALLCKLOCIGALLCKLOCIG
1Ant-1.30.700.600.510.290.250.38
2Ant-1.40.660.710.130.190.130.20
3Ant-1.50.800.660.310.340.410.42
4Ant-1.60.780.750.480.420.430.46
5Ant-1.70.910.900.660.470.450.52
6Camel-1.00.830.880.560.340.340.19
7Camel-1.20.880.790.570.250.250.24
8Camel-1.40.880.860.550.210.220.26
9Camel-1.60.920.870.460.200.260.23
10Ivy-1.10.650.520.650.390.350.34
11Ivy-1.40.740.750.480.300.280.30
12Ivy-2.00.810.850.520.390.390.42
13Jedit-3.50.840.800.200.500.390.45
14Jedit-4.00.710.760.380.460.470.51
15Jedit-4.10.780.840.410.600.530.57
16Jedit-4.20.760.830.380.480.470.48
17Jedit-4.30.750.800.490.140.170.16
18Log4j-1.00.840.790.430.380.290.24
19Log4j-1.10.790.780.340.330.160.28
20Log4j-1.20.600.840.390.250.190.19
21Lucene-2.00.690.970.140.270.270.33
22Lucene-2.20.860.880.390.290.230.23
23Lucene-2.40.940.970.780.370.340.31
24Poi-1.50.880.880.250.380.300.33
25Poi-2.00.880.970.280.230.210.25
26Poi-2.50.910.930.480.350.260.34
27Poi-3.00.920.940.790.360.300.39
28Synapse-1.00.650.750.850.330.270.33
29Synapse-1.10.820.870.350.380.290.30
30Synapse-1.20.960.990.470.450.320.33
31Velocity-1.40.790.800.480.180.170.21
32Velocity-1.50.920.930.630.260.200.30
33Velocity-1.60.770.880.660.320.320.34
34Xalan-2.40.810.880.830.380.320.40
35Xalan-2.50.900.920.090.410.330.34
36Xalan-2.60.860.880.160.500.440.44
37Xalan-2.70.870.950.170.510.380.38
38Xerces-1.20.880.800.630.240.200.24
39Xerces-1.30.830.820.740.330.330.29
40Xerces-1.40.880.800.820.370.300.30
41Xerces-init0.790.700.230.350.370.36
Mean0.815610.831463410.4663410.3506590.312048780.334976
Median0.830.840.480.350.3030.331
Table 7. Cohen’s d, Glass’s delta, and Hedges’ g results.
Table 7. Cohen’s d, Glass’s delta, and Hedges’ g results.
AlgorithmCohen’s dGlass’s DeltaHedges’ g
KNN (all)2.5372.1952.537
KNN (ckloc)3.1802.7253.180
KNN (IG)2.8462.3912.846
ANN filter (all)2.2327.0372.232
ANN filter (ckloc)2.1113.6052.111
ANN filter (IG)0.0640.0560.064
RFE (all)3.4327.7513.432
RFE (ckloc)2.8684.5672.868
RFE (IG)0.5860.5310.586
Classifier (all)4.8745.2544.874
Classifier (ckloc)5.3025.1485.302
Classifier (IG)0.8110.6340.811
Table 8. Wilcoxon signed rank test results.
Table 8. Wilcoxon signed rank test results.
Algorithmp-Value (Wilcoxon Test)
KNN vs. ANN filter-all0.00364
KNN vs. ANN filter-ckloc0.00217
RFE vs. GA-all0.00261
RFE vs. GA-ckloc0.00564
RFE vs. GA-IG0.00013
Classifier vs. NB-ckloc0.00024
Classifier vs. NB-IG0.00128
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Faiz, R.b.; Shaheen, S.; Sharaf, M.; Rauf, H.T. Optimal Feature Selection through Search-Based Optimizer in Cross Project. Electronics 2023, 12, 514. https://doi.org/10.3390/electronics12030514

AMA Style

Faiz Rb, Shaheen S, Sharaf M, Rauf HT. Optimal Feature Selection through Search-Based Optimizer in Cross Project. Electronics. 2023; 12(3):514. https://doi.org/10.3390/electronics12030514

Chicago/Turabian Style

Faiz, Rizwan bin, Saman Shaheen, Mohamed Sharaf, and Hafiz Tayyab Rauf. 2023. "Optimal Feature Selection through Search-Based Optimizer in Cross Project" Electronics 12, no. 3: 514. https://doi.org/10.3390/electronics12030514

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop