# Comparative Study on Heart Disease Prediction Using Feature Selection Techniques on Classification Algorithms

Authors: Kaushalya Dissanayake; Md Gapar Md Johar
Journal: Applied Computational Intelligence and Soft Computing
 (2021)

---

## Abstract

Heart disease is recognized as one of the leading factors of death rate worldwide. Biomedical instruments and various systems in hospitals have massive quantities of clinical data. Therefore, understanding the data related to heart disease is very important to improve prediction accuracy. This article has conducted an experimental evaluation of the performance of models created using classification algorithms and relevant features selected using various feature selection approaches. For results of the exploratory analysis, ten feature selection techniques, i.e., ANOVA, Chi-square, mutual information, ReliefF, forward feature selection, backward feature selection, exhaustive feature selection, recursive feature elimination, Lasso regression, and Ridge regression, and six classification approaches, i.e., decision tree, random forest, support vector machine, K-nearest neighbor, logistic regression, and Gaussian naive Bayes, have been applied to Cleveland heart disease dataset. The feature subset selected by the backward feature selection technique has achieved the highest classification accuracy of 88.52%, precision of 91.30%, sensitivity of 80.76%, and f-measure of 85.71% with the decision tree classifier.


---

## Body

## 1. Introduction

With the enhancement of the information era, computer-aided systems generate massive amounts of raw data, enhancing the new center of power. Acquiring important knowledge from this form of data is a challenging task for practitioners. Data mining, Artificial Intelligence, machine learning, and deep learning are relatively modern and promising technologies for obtaining relationships or identifying significant databases using advanced statistical approaches. Medical data mining and knowledge exploration constitute a relatively new and developing domain that is of interest to many researchers [1].With the improvement of medical data gathering, physicians have the potential to diagnose ailments better. In addition, computational biomedical systems can speed up the decision-making process and achieve greater prediction accuracy in different diseases such as heart diseases, cancers, diabetes, skin diseases, and kidney diseases. Among these ailments, cardiovascular diseases have been identified as having the highest mortality rate in most countries worldwide [1–4].According to the World Health Organization (WHO), cardiovascular disease mortality will rise to almost 30 million by 2040 [2]. Electrocardiogram (ECG), echocardiogram (heart ultrasound), cardiac magnetic resonance imaging (MRI), stress tests (exercise stress test, stress ECG, nuclear cardiac stress test), and angiography are commonly used tests by physicians to help identify cardiovascular problems. However, diagnostic and treatment costs are relatively high for cardiovascular disease and not affordable for the whole community. Data mining methods enable the efficient determination of whether patients are at an increased risk of heart disease at an early stage and, thus, enable the decrease of the costs of diagnosis and treatment.In this respect, researchers investigated feature selection approaches and various classifiers on various heart disease datasets, including Statlog, Cleveland, Hungary, VA Long Beach, and Switzerland datasets from the UCI Machine Learning Repository, as well as the Z-Alizadeh Sani datasets.When diagnosing various diseases using a computer-based system, high-dimensional and heterogeneous data must be processed and analyzed. High-dimensional data frequently results in model overfitting and increases the training time of the model. Feature selection is a dimensionality reduction technique used to reduce a set of considerable number of data features to a manageable set by eliminating irrelevant and redundant features that have no significant impact on classifier performance. Numerous effective feature selection methods have been developed recently to mitigate the curse of dimensionality. Algorithms for feature selection can be classified as supervised, unsupervised, or semisupervised [3]. Supervised feature selection is the initial and most prevalent technique for selecting features that use labeled data. Three approaches are utilized in supervised feature selection methods: filter, wrapper, and embedded approaches.Filter-based techniques are used at the preprocessing stage, independently of the learning algorithm being used. Using statistical measures, this approach calculates the score based on their dependency on the class label for each feature [5–7]. Following that, all features are sorted further using these scores to choose a predetermined number of relevant features. The filter technique can employ various feature selection criteria, including correlation coefficient (Pearson, Spearman, and Kendall Tau), Relief, Chi-square, information gain, and Fisher score.Wrapper techniques use a particular learning algorithm in order to find out which features are most fit for a certain dataset. Then, the selected features are determined by the prediction accuracy of the learning algorithm. Following that, features are added to or eliminated from the subset based on the accuracy of the model. This loop continues until the optimal subset is discovered. The complexity of these approaches might be relatively high if the dataset has several dimensions. Forward feature selection, backward feature elimination, recursive feature elimination, and exhaustive feature selection are examples of wrapper-based feature selection techniques dependence [5–7].The embedded techniques combine the advantages of filter and wrapper techniques. Here, algorithms incorporate their feature selection criteria. By adding attribute selection to the training process, these techniques minimize computational complexity. This approach is typically considerably more accurate at prediction and more efficient than filter and wrapper methods. Lasso regression, Ridge regression, and memetic algorithm are examples of embedded methods [5–7].The purpose of this study is to determine the effect of several feature selection algorithms classified as filter, wrapper, and embedded techniques on improving the prediction of heart disease. An experimental approach that performs comprehensive experiments on real datasets relevant to heart disease that have been made available through the University of California, Irvine (UCI) data repository was employed to accomplish the goal.We develop many predictive models, including feature selection, and evaluate them against various performance measures, including accuracy, precision, and recall, to identify the most successful ones that might be utilized for heart disease prediction and benefit the medical community.


## 2. Literature Survey

Ritu et al. [4] presented a sequential feature selection method for identifying mortality events in patients with heart disease during treatment to find the most critical features. Numerous machine learning methods are utilized, including LDA, KNN, RF, SVM, DT, and GBC. In addition, the confusion matrix, receiver operating characteristic curve, precision, recall rate, and F1-score are also generated to validate the SFS algorithm's results. The experimental findings indicated that the sequential feature selection technique achieves an accuracy of 86.67% for the random forest classifier.Gao et al. [5] suggested a model using ensemble approaches (boosting and bagging) with feature extraction algorithms (LDA and PCA) for predicting heart disease. The authors compared ensemble techniques (bagging and boosting) with five classifiers (SVM, KNN, RF, NB, and DT) on selected features from the Cleveland heart disease dataset. The results of the experiments indicated that the bagging ensemble learning method with DT and PCA feature extraction obtained the most outstanding performance.Takci [6] used twelve classification algorithms from various categories and four feature selection methods for heart attack prediction. The models were evaluated based on the accuracy of the model, the processing time, and the findings of the ROC analysis. The result shows that, without feature selection, the maximum accuracy value was 82.59%; it increased to 84.81% with feature selection. Model accuracy of 84.81% was obtained using naive Bayes and linear SVM. Additionally, the processing time was decreased from 359 to 187 milliseconds. The ReliefF algorithm provides the best model accuracy among the four alternative feature selection techniques according to the mean accuracy value. Thus, the author mentioned that when the appropriate combinations are considered, feature selection has a beneficial effect in heart attack prediction research.Latha et al. [7] proposed a model to predict heart disease risk using ensemble classification techniques and feature selection techniques. The study findings showed that ensemble approaches like bagging and boosting are useful in increasing the prediction accuracy of weak classifiers and perform well in predicting heart disease risk. Ensemble classification improved the accuracy of weak classifiers by up to 7%. The performance was further increased by adding a feature selection implementation, which resulted in a substantial increase in prediction accuracy.KarenGárate-Escamila et al. [8] proposed a hybrid dimensionality reduction technique combining Chi-square and principal component analysis (CHI-PCA) to predict heart disease. Their study was conducted on three different datasets: Hungarian, Cleveland, and Hungarian-Cleveland datasets gathered from the UCI Machine Learning Repository. The performance of the suggested technique was evaluated with five different classifiers: random forests, gradient-boosted tree, decision tree, multilayer perceptron, and logistic regression. Chi-square and principal component analysis (CHI-PCA) using random forests (RF) showed the most remarkable accuracy, at 98.7% for the Cleveland dataset, 99.0% for the Hungarian dataset, and 99.4% for the Cleveland–Hungarian (CH) dataset, respectively.Spencer et al. [9] conducted experiments on four frequently used heart disease datasets using four different feature selection techniques: principal component analysis, Chi-squared testing, ReliefF, and symmetrical uncertainty. As noted by the authors, the benefits of feature selection differ depending on the machine learning approach employed for the cardiac datasets. For example, one of the most accurate models discovered had an accuracy of 85.0%, a precision of 84.73%, and a recall of 85.56% when Chi-squared feature selection was combined with the BayesNet classifier.Semen et al. [10] constructed a diagnostic model for chronic kidney disease detection utilizing a dataset of 400 patients with 24 features. Recursive feature elimination (RFE) was used to select the most significant features. The k-nearest neighbors (KNN), support vector machine (SVM), decision tree, and random forest classification methods were used in this work. All classification methods achieved excellent performance. The random forest method beat all other algorithms, achieving 100% accuracy, recall, precision, and F1-score on all metrics.Almansour et al. [11] used machine learning methods to assist in the early detection of chronic kidney disease by comparing two classifiers, SVM and ANN, improving their parameters using a random exhaustive search method. The 400-instance dataset from the UCI repository is preprocessed, and features are chosen using correlation coefficients. The classifiers' performance is compared against various best features (2, 3, 6, 12, and all) and the computing time required to train the model. Finally, the twelve best features are used to predict renal illness using SVM and ANN since ANN surpasses SVM with high accuracy.From the literature, it is evident that classifier training using relevant features selected by different feature selection algorithms enhances the accuracy of the classifier.


## 3. System Framework

The proposed study focuses on increasing classification accuracy by decreasing the number of features in a dataset of cardiac disease. The framework for classifying cardiac diseases is depicted in Figure1. The key components of the framework include data collection, data preprocessing, feature selection, data splitting, model training with classifiers, and model evaluation. The following sections describe the building blocks of the suggested framework.Figure 1
System framework.


### 3.1. Data Collection

This study gathered Cleveland heart disease datasets from a repository called UCI (University of California, Irvine) which can be accessed online for testing purposes. However, there were 303 instances and 75 features when this dataset was developed. All published studies [2, 4, 6, 7, 12] make use of a selection of 14 features, including biographic features, clinical features, and habitual features in the dataset, along with one output feature. A detailed description of the dataset is provided in Table 1. The label of output feature (num) is divided into two classes to denote the presence of heart disease and absence of heart disease.Table 1
Description of Cleveland heart disease dataset.
Feature IDFeature nameFeature typeDescriptionValuesF1AGENumericalAge in years28–77; Mean: 51.9F2SEXNominalGender (1: male; 0: female)1: (206); 0: (97)F3CPNominalChest pain type (1: typical angina; 2: atypical angina; 3: nonanginal pain; 4: asymptomatic)1: (23)2: (50)3: (86)4: (144)F4TRESTBPSNumericalResting blood pressure (in mmHg on admission to the hospital)94–200; mean: 131.6F5CHOLNumericalSerum cholesterol (in mg/dl)126–564; mean: 246.6F6FBSNominalFasting blood sugar >120 mg/dl (1: true; 0: false)1:(45); 0: (258)F7RESTECGNominalResting electrocardiographic results (2: showing probable or definite left ventricular hypertrophy by Estes' criteria, month of exercise ECG reading; 1: having ST-T wave abnormality; 0: normal)2: (148);1: (4); 0: (151)F8THALACHNumericalMaximum heart rate achieved71–202; mean: 149.6F9EXANGNominalExercise-induced angina (1: yes; 0: no)1: (99); 0: (204)F10OLDPEAKNumericalST depression induced by exercise relative to rest0–6.2; mean: 1.03F11SLOPENominalThe slope of the peak exercise ST segment (3: downsloping; 2: flat; 1: upsloping)3: (21);2: (140); 1: (142)F12CANominalNumber of major vessels (0–3)3: (24);2: (38); 1: (65);0: (176)F13THALNominalThe heart status (7: reversible defect; 6: fixed defect; 3: normal)7: (117);6: (18); 3: (168)F14TARGETNominalDiagnosis of heart disease (1: presence; 0: absence)1: (139)0: (164)


### 3.2. Data Preprocessing

Preprocessing the dataset is necessary for the effective representation of the quality of data. The dataset has been preprocessed using techniques such as eliminating missing values from features, StandardScaler (SS), and MinMaxScaler. Missing value handling is a data preprocessing technique used to create a smooth dataset. Thus, it was started by determining if the dataset contains any missing values [2, 5]. The missing values can be handled in various ways, including totally ignoring the missing value, replacing it with any numeric value, replacing it with the most often occurring (mode) value for that feature, or replacing it with the mean value of the attribute. The heart disease dataset used in this article consists of six missing values. The missing values are replaced with the mean or mode values of the features.


### 3.3. Feature Selection

In this stage, experiments were conducted with and without feature selection to assess the effect of feature selection. The feature selection aims to identify the most significant features of cardiac diseases. Furthermore, feature selection helps to construct a more accurate model by eliminating or underrepresenting the less relevant features, minimizing training time and enhancing learning performance [6]. The behavior of several feature selection approaches under the three major categories (filter, wrapper, and embedded) is assessed in this experiment. As illustrated in Figure 2, feature selection techniques belonging to three categories were separately applied to initial datasets. Feature selection techniques begin by creating a subset, but that subset generation depends on the type of approach. Figure 2 illustrates the process of feature selection followed by each of the three categories to identify optimal feature subsets.Figure 2
System framework for feature selection.As illustrated in Figure2, the filter technique chooses the best subset immediately before passing it to the learning algorithm. The remaining two approaches, wrapper and embedded, create the optimal subset in combination with the learning algorithm. In contrast to the other techniques, the embedded method incorporates the benefits of both the filter and wrapper methods.


#### 3.3.1. Feature Selection Using Filter Methods

Filter-based selection techniques utilize statistical methods to determine the dependence or association among independent features (input attributes) and the dependent feature (target attribute).In filter method, without depending on any learning algorithms, features are assessed based on the general properties of the data as represented in Figure3. On the other hand, characteristics are chosen based on the output results/scores generated by the various statistical methods used to validate them.Figure 3
Summary of features selected by feature selection algorithms.It primarily quantifies the properties of features using distinct types of measurement criteria, including information, distance, dependence, consistency, similarity, and statistical measures. These attributes are compared for their interdependence with the output attribute to choose the appropriate subset [13–16].This proposed work mainly uses four filter-based feature selection algorithms, namely, Chi-square, mutual information, ReliefF, and ANOVA F method.(1) Chi-Square. The Chi-square test follows the univariate statistical approach in feature selection to identify the dependence of each feature (or correlation) with the target variable in a dataset [8]. Here, remove the features independent of the target variable and other dependent features considered highly important to predict the target variable. The steps involved in this process are given as follows.Step 1: select all the features from the original dataset.Step 2: calculate the Chi-square scores to determine the independence of two features using chi2() function that is in the scikit-learn machine library. Here, use (1) to determine the Chi-square score for each feature given as follows.(1)X2=∑fO−fE2fE,wherefO is the observer frequency and fE is the expected frequency.The observed frequency is close to the expected frequency, resulting in a lower Chi-square score when two features are independent.Step 3: the feature with a larger Chi-square value relies more on the target feature and is thus chosen for model construction. SelectKBest() was used to select the ten features with the highest Chi-square score shown in Table2; K denotes the number of features to be included in the final dataset.Step 4: based on the top ten ranking features in Table2, the next step is needed to select a threshold to create subsets for the number of features represented by n, i.e., the optimum number of features with the highest Chi test score to be utilized. During the search process, start with a subset of features with n = 5, i.e., only five features with the highest Chi test score, to create the initial feature subset.Step 5: in the second iteration, another subset of features withn = 6 is generated by picking the first six features with the greatest Chi score. The same procedure is performed with n = 7, 8, 9, 10 for ranking features to create distinct feature subsets.Table 2
Ranking order of features based on filter-based techniques.
RankANOVAChi-squareMutual informationRelief1F13F8F13F132F12F12F12F123F10F10F9F94F9F13F3F105F8F5F10F36F3F9F8F107F11F1F11F88F2F4F5F29F1F3F6F110F7F7F2F711F5F2F1F512F4F11F7F413F6F6F4F6(2) Mutual Information. The mutual information (MI) between two random variables is a metric measuring their interdependence or measures the reduction in uncertainty. The actions necessary to complete this process are listed below.Step 1: select all the features from the original dataset.Step 2: calculate mutual information scores to determine the relationship between the features and the target feature using the mutual_info_classif() function. When calculating mutual information scores, the following steps and formulas are used.In predicting the unknown class of samples, entropy and conditional entropy principles can be used to assess a given feature's efficiency [15, 17, 18]. The entropy of H (X) for the values {x1, x2,..., xn} can be given as(2)HX=−∑i=1npxilog2pxi,wherepxi means probability mass function of xi.The conditional entropy for the two discreteX and Y random variables is given as(3)HX|Y=−∑i=1n∑j=1nPxi,yjlog2PxiPxi,yj,wherep (xi, yj) is X = xi and Y = yj joint probability.The mutual information [MI (X; Y)] of the respective variables X and Y can be computed in terms of both the entropy of X, H (X) and the conditional entropy H (C|X) as(4)MIX:Y=HX−HX|Y.Step 3: a higher score indicates the presence of additional dependence on target variable. SelectKBest() was used to choose the ten features with the highest mutual information scores for model construction, as indicated in Table2.Step 4: considering the best ten ranking features in Table2, the next step is to determine the optimal number of features (n) with the highest mutual information scores to be used for feature subsets. During the search procedure, we began with a subset of features with n = 5, i.e., the five features with the greatest mutual information scores.Step 5: another subset of features withn = 6 is created in the second iteration by selecting the first six features with the highest mutual information scores. For n = 7, 8, 9, 10, the same technique is used to rank features to produce separate feature subsets.(3) ReliefF Algorithm. The ReliefF is a supervised feature learning approach to weigh each feature, demonstrating its importance to the target variable used for binary and multiclass problem domains. The steps required to accomplish this procedure are summarized below.Step 1: select all the features from the original dataset.Step 2: calculate the weight of each feature using the ReliefF() function. The weight is defined by the closest neighbor of the same class and different classes [6, 9, 12]. The sample instance compared the values of the nearest neighbor features and modified the weight of every feature. The weight vector of a feature in binary classification is given in the following equation:(5)Wi=Wi−xi−nearHiti2+xi−nearMissi2,where nearHit is the nearest same-class instance and nearMiss is the nearest different-class instance.The Manhattan (L1) distance is used to find the nearHit and nearMiss instances rather than the Euclidean (L2) distance used in a ReliefF algorithm. Furthermore, ReliefF algorithm updates weight vectors when considering the absolute differences betweenxi and nearHit rather than the square between xi and nearHit.Step 3: compute the feature importance to the target variable based on the weights using feature_importances_.Step 4: Considering the feature importance values, features having higher scores are selected for model development, indicating additional dependence on target variable. SelectKBest() is used to choose the ten features with the highest feature importance values; K denotes the number of features for model construction, as indicated in Table2.Step 5: after selecting the highest ten ranking features in Table2, the next step is to identify the ideal number of features (n) to be employed for each feature subset. We began the search method with a subset of n = 5 features, i.e., the five features having the highest feature importance values.Step 6: in the second iteration, another subset of features withn = 6 is produced by choosing the first six features with the greatest feature importance values. The same approach is used to rank features for n = 7, 8, 9, 10 to generate distinct feature subsets.(4) ANOVA Method. ANOVA (Analysis of Variance) is a statistical test that formulates the ratio between variances, such as the variance from two different samples. Furthermore, ANOVA is beneficial in classification; the data come up with numeric input and categorical target variables [11, 19]. The steps necessary to complete this process are listed below.Step 1: select all the features from the original dataset.Step 2: calculate the ANOVA F-scores between each feature and the target feature using f_classif() function that is in the scikit-learn machine library. Here, use the following formula to calculate the one-way ANOVA F-test.(6)F=variancebetweengroupsvariancewithingroups,variancebetweengroups=∑i=1nniY¯i−Y¯2K−1,variance withingroups=∑i=1K∑j=1niYij−Y¯i2N−K,whereY¯i is the ith group sample mean, ni is the number of observations in the ith group, Y¯ is the overall mean of the data, K is the number of groups, Yij is the jth observation in the ith out of K groups, and N is the overall sample size.Step 3: the score of this test is used to perform feature selection, which allows for the elimination of features that are not related to the target variable. SelectKBest() was used in this experiment to choose the most relevant top ten features with the lowest variance;K denotes the number of features we want in the final dataset. Table 2 lists the initial top ten features for model building.Step 4: after selecting the highest-ranking features in Table2, the ideal number of features (n) with the highest ANOVA F-scores to be used is determined to create various feature subsets.We began the search method with a subset ofn = 5 features, i.e., the five features with the highest ANOVA F-scores.Step 5: in the second iteration, a subset of features withn = 6 is formed by choosing the top six features with the greatest ANOVA F-scores. The same approach is used to rank features for n = 7, 8, 9, 10 to generate distinct feature subsets.


#### 3.3.2. Feature Selection Using Wrapper Methods

This method mainly utilizes a search strategy to evaluate the variable subsets of independent featuresS'⊆S by feeding S′ to the chosen learning algorithm and then assessing the performance of a learning algorithm. When the cardinality of features in a dataset comes up with N, the 2N subsets are possible, and the steps are done iteratively before the required suboptimal subsets are found. Thus, the value of the cardinality is very high, and the number of subsets is exponential. The searching method can identify various types of techniques and in this experiment mainly used four types of techniques: forward feature selection, backward feature elimination, recursive feature elimination, and exhaustive feature selection described below [13, 14, 20, 21]. The parameter settings for the wrapper-based algorithms are included in Table 3.Table 3
Parameter settings for wrapper-based techniques.
TechniqueFeature selection functionParametersForward feature selectionsklearn.feature_selection.SequentialFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10, direction = 'forward',scoring = 'accuracy',cv = 5,n_jobs = -1Backward feature eliminationsklearn.feature_selection.SequentialFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10, direction = 'backward',scoring = 'accuracy',cv = 5,n_jobs = -1Recursive feature eliminationsklearn.feature_selection.RFE()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10,step = 1,verbose = 2Exhaustive feature selectionmlxtend.feature_selection.ExhaustiveFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),min_features = 4,max_features = 5/6/7/8/9/10, scoring = 'accuracy', cv = 5,n_jobs = -1(1) Forward Feature Selection (FFS). Forward feature selection is an iterative procedure that begins with the feature having the highest performance versus the target feature. When selecting the feature subset, with support vector machine used as a learning algorithm, stratification is required to guarantee that each class is well represented [4]. Each subset is evaluated independently, and the creation of subsets is determined by the search method. The following are the steps required to complete the feature selection procedure.Step 1: all the features were selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 for then_features_to_select parameter.Step 3: the process starts with adding one feature that obtained a higher cross-validation score. Then, after iteration, choose another feature that optimally performs when combined with the initially selected feature. This procedure is repeated until reaching the desired number of features to be chosen.Step 4: select the optimal feature subset according to the highest average score of the classifier in Step 3.Step 5: steps 2 and 3 are repeated by changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(2) Backward Feature Elimination (BFE). The approach of backward elimination is the complete opposite of the method of forward feature selection [4]. The following stages are followed to finish the feature selection procedure.Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 for then_features_to_select parameter.Step 3: the process begins by assembling all accessible features into a model. Following that, each iteration eliminates the least significant feature, thereby improving the performance of the model. This method is continued until the desired number of characteristics available for selection is reached.Step 4: select the optimal feature subset according to the highest average score of the classifier in Step 3.Step 5: steps 2 and 3 are repeated by changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(3) Recursive Feature Elimination (RFE). Recursive feature elimination uses an approach to iteratively train the model, removing the least significant feature using the algorithm's weights as a criterion for each iteration. Recursive feature elimination aims to choose features by examining smaller and smaller sets of features in a recursive fashion. The following steps are used to complete the feature selection method [10, 21].Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 forn_features_to_select parameter.Step 3: at the beginning, the estimator is trained on the original set of features, and the significance of each feature is determined using either the coef_ or feature_importances_ attributes.Step 4: the least significant features in the current set of features are trimmed. This method is done repeatedly until the trimmed group has the required number of features to be selected.Step 5: steps 3 and 4 are repeated with changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(4) Exhaustive Feature Selection (EFS). When determining the optimum feature subset, the exhaustive feature selection approach used brute-force strategies. The performance of the machine learning algorithm is assessed against all potential feature combinations in the dataset. The optimum feature subset is determined by the one that produces the best performance. The exhaustive search algorithm is the greediest algorithm of the wrapper techniques since it attempts all possible combinations of features and chooses the best [11]. The disadvantage of exhaustive feature selection is that it is slower than the step forward and step backward approach since it examines all possible feature combinations [11]. The steps to select the optimal feature subset using EFS are outlined below.Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the min_features as one and max_features as 5.Step 3: the performance of the machine learning algorithm is assessed against all potential feature combinations in the dataset. The optimum feature subset is determined by the one that produces the best performance. The exhaustive search algorithm is the greediest algorithm of the wrapper techniques since it attempts all possible combinations of features and chooses the best.Step 4: step 3 is repeated by changing the value of max_features to 6, 7, 8, 9, 10, respectively.Step 5: using Step 4, the optimal feature subsets for the number of features assigned in Step 4 are identified.


#### 3.3.3. Feature Selection Using Embedded Methods

Embedded techniques include integrating the feature selection process into the machine learning algorithm's development. This is a hybrid technique that combines the filter and wrapper methods. Here, the algorithms include their feature selection strategy. These contribute to the generation of the optimal subset and offer it to the training model. In other words, they pick features during model training, which is why they are referred to as embedded techniques. These techniques need less computation than wrapper methods. The design of embedded feature selection approaches is algorithm dependent. However, developing a mathematical model for a feature selection embedded classifier is quite difficult [13,14,20].(1) Lasso Regression. The abbreviation “Lasso” refers to the Least Absolute Selection and Shrinkage Operator. In Lasso, the penalty is defined as the total of the absolute values of the coefficients, which is L1. Thus, the primary goal of Lasso is to reduce an absolute value (L1 penalty) to zero rather than to use the sum of squares (L2 penalty) [18, 22]. The following steps explain the procedures of selecting the optimum feature subset using Lasso.Step 1: all the features are selected from the original dataset.Step 2: make a pipeline object using StandardScaler and Lasso in scikit-learn.Step 3: optimize theα hyperparameter that tunes the intensity of Lasso regression using several values from 0.1 to 10 with 0.1 steps.Step 4: calculate the mean squared error on a fivefold cross-validation basis and choose the value that minimizes such average performance metrics.Step 5: get the absolute values of the magnitude of the coefficients of the Lasso regression. Select the feature that takes nonzero value for the best feature subset.(2) Ridge Regression. Ridge regression employs L2, with the penalty equal to the sum of the squares of the coefficients of the variables. This form of regression aids in the reduction of variation caused by variable multicollinearity. It contributes to the removal of variation caused by nonlinear correlations between two independent variables [18]. The following steps describe how to use Ridge to choose the optimal feature subset.Step 1: all the features are selected from the original dataset.Step 2: create a pipeline object in scikit-learn using StandardScaler and Ridge.Step 3: optimize the alpha hyperparameter that tunes the Ridge regression's intensity using multiple values ranging from 0.1 to 10 with a 0.1 step.Step 4: using fivefold cross-validation, calculate the mean squared error and select the value that minimizes such average performance metrics.Step 5: calculate the Ridge regression's squared coefficients. For the best feature subset, select the features that have a nonzero value.


### 3.4. Data Splitting

The heart disease dataset is split into an 80% training set and a 20% testing set in this phase. The training set was used to develop the models, while the testing set was used to assess them. Additionally, a 10-fold cross-validation technique was used for validating the training phase of the classifier.


### 3.5. Training Models

Classification is a method for labeling a particular set of data with different classes, which is carried out on structured and unstructured data. The aim of classification predictive modeling is to approximate mapping between input variables and discrete output variables. There are several classification algorithms available, but one that is better than another cannot be concluded. This relies on the domain of the problem and the nature of the dataset available [10].In this analysis, we used six different supervised learning algorithms, which are decision tree, random forest, support vector machine, K- nearest neighbor, logistic regression, and Gaussian naive Bayes.


#### 3.5.1. Support Vector Machines (SVM)

This classifier showed great empirical successes in classification tasks under supervised machine learning techniques. It separates data into different classes by a hyperplane or hyperplanes since it can handle multidimensional data. SVM separates data into hyperplanes with the help of the following mathematical formulas:(7)positive hyperlane:wTx+b=+1,(8)optimal hyperlane:wTx+b=0,(9)negative hyperlane:wTx+b=+1,where x is the vector point and w is the weight vector.SVMs minimize the error in empirical classification and optimize the classification margin. SVM models can be categorized into four distinct categories, according to the error function method: Nu-SVM regression, C-SVM classification, Nu-SVM classification, and Epsilon-SVM regression. Support vector machine algorithm is deployed with kernel functions such as radial basis, polynomial, linear, and sigmoid kernels, which convert nonlinear data map to the linear form [2, 4, 10]. In this experiment, linear kernel function is used for classification.


#### 3.5.2. Decision Tree (DT)

A decision tree algorithm can be categorized under supervised learning, which is identical to a tree of nodes and edges ideal for classification problems. Every node in the tree represents the class of the problem, and every edge indicates the choice made based on the evaluated results. This classifier can be considered a predictive machine learning model that displays the correlation between dataset values and features. Each division in the decision tree indicates the potential value for a certain category. Dependent on entropy measurements of the dataset attributes, the nodes are identified. The maximum entropy value attribute is known to be the root node. C4.5, Iterative Dichotomiser 3(ID3), and Classification and Regression Trees (CART) are widely used decision tree models [2, 4, 10].


#### 3.5.3. Random Forest (RF)

One of the most widely used, technologically advanced, supervised ensemble classification methods is called random forest. It generates a large number of trees during the training stage and builds a forest of decision trees on multiple data subsets. At the testing stage, each tree in the forest assigns each piece of data a class label. When each tree predicts a class label, the ultimate determination for each set of test data is made by a majority vote. Whichever class label receives the greatest number of votes is assumed to be the right label for the test data to enhance its prediction accuracy. This procedure is performed for each piece of data in the dataset [2, 10].


#### 3.5.4. K-Nearest Neighbor (KNN)

K-nearest neighbor is a technique of supervised learning used to recognize the patterns in the dataset and determine the belonging class based on the points of existence with the nearest neighbors. It determines the class of instance by considering the distance from the nearest neighbor and consistency. KNN uses different distance functions such as Manhattan, Euclidean, Hamming, and Minkowski when identifying the neighbor's points. This method is called a memory dependent approach because all the instance points are stored inside the memory [2, 4, 10]. The weight is allocated for each point depending on the distance from each instance to improve the algorithm's performance. The following equation is used to calculate the Euclidean distance:(10)D=∑i=1nxi−yi2.


#### 3.5.5. Logistic Regression (LR)

Logistic regression is a widely used machine learning method that falls into the category of supervised learning. It is used to forecast a categorical dependent variable based on a set of independent variables. For example, it is used to extract significant statistical items from the model or forecast the tendency of data [2, 18]. The dependent variable in logistic regression is a binary variable that contains data coded as 1 (yes, success, etc.) or 0 (no, failure, etc.). The logistic regression algorithm is based on the logistic function shown below:(11)PX=11+e−fx,where f(x) is a function consisting of features (xk) and their corresponding weights/coefficients (βk) in a linear form shown as below:(12)fx=x0+x1β1+…+xkβk+ε,where x, β, f(x)∈Rk and ε represents the random error process noise inevitably happening in the data generating process. The sigmoid function is a mathematical function that converts linear regression to logistic regression. It converts any real number to another value between 0 and 1.


#### 3.5.6. Gaussian Naive Bayes (GNB)

This algorithm, based on the theorem of Bayes, expects independence between two variables. The construction of a Bayesian model is simple and particularly realistic, based on the massive datasets. Naive Bayes' simplicity and dominance over complex approaches are well established [2, 8].Gaussian naive Byes is used when all of the data values of a dataset are numeric. The probability density function is defined using the mean and standard deviation. Next, it computes the mean and standard deviation for each of the dataset's features. After computing this, the probabilities for each test data pattern are calculated using the mean and standard deviation when any test data pattern occurs. Finally, it assigns an appropriate class label to the test data whose probability is near to 1. The following equation is used to determine the likelihood.(13)Pxi|y=12πσy2exp−xi−μy22σy2,where μy is the mean and σy is the standard deviation.The parameter setting of the learning algorithms is described in Table4.Table 4
Parameter settings for classifier.
Classification algorithmBasic parametersRandom forest (RF)n_estimators = 100, random_state = 0, n_jobs = -1Support vector machine (SVM)kernel = “linear”, degree = 2Decision tree (DT)Criterion = “gini”, splitter = “best”, random_state = 0K-nearest neighbor (KNN)n_neighbors = 4, weights = “distance”,n_jobs = -1Logistic regression (LR)C = 1, penalty = “l1/l2”, solver = “liblinear”, random_state = 7Gaussian naive Bayesvar_smoothing = 0.05


### 3.6. Evaluating Models

Various assessment metrics are applied to determine the efficiency of the feature selection techniques in this study, namely, precision, F1-score, accuracy, and recall, with the help of elements in the confusion matrix. The confusion matrix allows researchers to identify the performance rate of the result in classification problems depending on four main factors: True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN).The accuracy will be shown by the model if it can raise proper identification of high risk level of getting heart disease. Accuracy can be calculated by(14)accuracy=TP+TNTP+TN+FP+FN.Precision, calculated as a summation of correctly identified instances, means that the proportion of patients diagnosed with heart disease actually had risk. Precision is given by(15)precision=TPTP+FP.Recall is the measure which indicates that the algorithm diagnosed the proportion of patients that actually had heart disease as having disease and is defined by(16)recall  or sensitivity=TPTP+FN.F-score computes the accuracy of the test, and the formula used to evaluate it is(17)F−measure=2×precision×recallprecision+recall.


## 3.1. Data Collection

This study gathered Cleveland heart disease datasets from a repository called UCI (University of California, Irvine) which can be accessed online for testing purposes. However, there were 303 instances and 75 features when this dataset was developed. All published studies [2, 4, 6, 7, 12] make use of a selection of 14 features, including biographic features, clinical features, and habitual features in the dataset, along with one output feature. A detailed description of the dataset is provided in Table 1. The label of output feature (num) is divided into two classes to denote the presence of heart disease and absence of heart disease.Table 1
Description of Cleveland heart disease dataset.
Feature IDFeature nameFeature typeDescriptionValuesF1AGENumericalAge in years28–77; Mean: 51.9F2SEXNominalGender (1: male; 0: female)1: (206); 0: (97)F3CPNominalChest pain type (1: typical angina; 2: atypical angina; 3: nonanginal pain; 4: asymptomatic)1: (23)2: (50)3: (86)4: (144)F4TRESTBPSNumericalResting blood pressure (in mmHg on admission to the hospital)94–200; mean: 131.6F5CHOLNumericalSerum cholesterol (in mg/dl)126–564; mean: 246.6F6FBSNominalFasting blood sugar >120 mg/dl (1: true; 0: false)1:(45); 0: (258)F7RESTECGNominalResting electrocardiographic results (2: showing probable or definite left ventricular hypertrophy by Estes' criteria, month of exercise ECG reading; 1: having ST-T wave abnormality; 0: normal)2: (148);1: (4); 0: (151)F8THALACHNumericalMaximum heart rate achieved71–202; mean: 149.6F9EXANGNominalExercise-induced angina (1: yes; 0: no)1: (99); 0: (204)F10OLDPEAKNumericalST depression induced by exercise relative to rest0–6.2; mean: 1.03F11SLOPENominalThe slope of the peak exercise ST segment (3: downsloping; 2: flat; 1: upsloping)3: (21);2: (140); 1: (142)F12CANominalNumber of major vessels (0–3)3: (24);2: (38); 1: (65);0: (176)F13THALNominalThe heart status (7: reversible defect; 6: fixed defect; 3: normal)7: (117);6: (18); 3: (168)F14TARGETNominalDiagnosis of heart disease (1: presence; 0: absence)1: (139)0: (164)


## 3.2. Data Preprocessing

Preprocessing the dataset is necessary for the effective representation of the quality of data. The dataset has been preprocessed using techniques such as eliminating missing values from features, StandardScaler (SS), and MinMaxScaler. Missing value handling is a data preprocessing technique used to create a smooth dataset. Thus, it was started by determining if the dataset contains any missing values [2, 5]. The missing values can be handled in various ways, including totally ignoring the missing value, replacing it with any numeric value, replacing it with the most often occurring (mode) value for that feature, or replacing it with the mean value of the attribute. The heart disease dataset used in this article consists of six missing values. The missing values are replaced with the mean or mode values of the features.


## 3.3. Feature Selection

In this stage, experiments were conducted with and without feature selection to assess the effect of feature selection. The feature selection aims to identify the most significant features of cardiac diseases. Furthermore, feature selection helps to construct a more accurate model by eliminating or underrepresenting the less relevant features, minimizing training time and enhancing learning performance [6]. The behavior of several feature selection approaches under the three major categories (filter, wrapper, and embedded) is assessed in this experiment. As illustrated in Figure 2, feature selection techniques belonging to three categories were separately applied to initial datasets. Feature selection techniques begin by creating a subset, but that subset generation depends on the type of approach. Figure 2 illustrates the process of feature selection followed by each of the three categories to identify optimal feature subsets.Figure 2
System framework for feature selection.As illustrated in Figure2, the filter technique chooses the best subset immediately before passing it to the learning algorithm. The remaining two approaches, wrapper and embedded, create the optimal subset in combination with the learning algorithm. In contrast to the other techniques, the embedded method incorporates the benefits of both the filter and wrapper methods.


### 3.3.1. Feature Selection Using Filter Methods

Filter-based selection techniques utilize statistical methods to determine the dependence or association among independent features (input attributes) and the dependent feature (target attribute).In filter method, without depending on any learning algorithms, features are assessed based on the general properties of the data as represented in Figure3. On the other hand, characteristics are chosen based on the output results/scores generated by the various statistical methods used to validate them.Figure 3
Summary of features selected by feature selection algorithms.It primarily quantifies the properties of features using distinct types of measurement criteria, including information, distance, dependence, consistency, similarity, and statistical measures. These attributes are compared for their interdependence with the output attribute to choose the appropriate subset [13–16].This proposed work mainly uses four filter-based feature selection algorithms, namely, Chi-square, mutual information, ReliefF, and ANOVA F method.(1) Chi-Square. The Chi-square test follows the univariate statistical approach in feature selection to identify the dependence of each feature (or correlation) with the target variable in a dataset [8]. Here, remove the features independent of the target variable and other dependent features considered highly important to predict the target variable. The steps involved in this process are given as follows.Step 1: select all the features from the original dataset.Step 2: calculate the Chi-square scores to determine the independence of two features using chi2() function that is in the scikit-learn machine library. Here, use (1) to determine the Chi-square score for each feature given as follows.(1)X2=∑fO−fE2fE,wherefO is the observer frequency and fE is the expected frequency.The observed frequency is close to the expected frequency, resulting in a lower Chi-square score when two features are independent.Step 3: the feature with a larger Chi-square value relies more on the target feature and is thus chosen for model construction. SelectKBest() was used to select the ten features with the highest Chi-square score shown in Table2; K denotes the number of features to be included in the final dataset.Step 4: based on the top ten ranking features in Table2, the next step is needed to select a threshold to create subsets for the number of features represented by n, i.e., the optimum number of features with the highest Chi test score to be utilized. During the search process, start with a subset of features with n = 5, i.e., only five features with the highest Chi test score, to create the initial feature subset.Step 5: in the second iteration, another subset of features withn = 6 is generated by picking the first six features with the greatest Chi score. The same procedure is performed with n = 7, 8, 9, 10 for ranking features to create distinct feature subsets.Table 2
Ranking order of features based on filter-based techniques.
RankANOVAChi-squareMutual informationRelief1F13F8F13F132F12F12F12F123F10F10F9F94F9F13F3F105F8F5F10F36F3F9F8F107F11F1F11F88F2F4F5F29F1F3F6F110F7F7F2F711F5F2F1F512F4F11F7F413F6F6F4F6(2) Mutual Information. The mutual information (MI) between two random variables is a metric measuring their interdependence or measures the reduction in uncertainty. The actions necessary to complete this process are listed below.Step 1: select all the features from the original dataset.Step 2: calculate mutual information scores to determine the relationship between the features and the target feature using the mutual_info_classif() function. When calculating mutual information scores, the following steps and formulas are used.In predicting the unknown class of samples, entropy and conditional entropy principles can be used to assess a given feature's efficiency [15, 17, 18]. The entropy of H (X) for the values {x1, x2,..., xn} can be given as(2)HX=−∑i=1npxilog2pxi,wherepxi means probability mass function of xi.The conditional entropy for the two discreteX and Y random variables is given as(3)HX|Y=−∑i=1n∑j=1nPxi,yjlog2PxiPxi,yj,wherep (xi, yj) is X = xi and Y = yj joint probability.The mutual information [MI (X; Y)] of the respective variables X and Y can be computed in terms of both the entropy of X, H (X) and the conditional entropy H (C|X) as(4)MIX:Y=HX−HX|Y.Step 3: a higher score indicates the presence of additional dependence on target variable. SelectKBest() was used to choose the ten features with the highest mutual information scores for model construction, as indicated in Table2.Step 4: considering the best ten ranking features in Table2, the next step is to determine the optimal number of features (n) with the highest mutual information scores to be used for feature subsets. During the search procedure, we began with a subset of features with n = 5, i.e., the five features with the greatest mutual information scores.Step 5: another subset of features withn = 6 is created in the second iteration by selecting the first six features with the highest mutual information scores. For n = 7, 8, 9, 10, the same technique is used to rank features to produce separate feature subsets.(3) ReliefF Algorithm. The ReliefF is a supervised feature learning approach to weigh each feature, demonstrating its importance to the target variable used for binary and multiclass problem domains. The steps required to accomplish this procedure are summarized below.Step 1: select all the features from the original dataset.Step 2: calculate the weight of each feature using the ReliefF() function. The weight is defined by the closest neighbor of the same class and different classes [6, 9, 12]. The sample instance compared the values of the nearest neighbor features and modified the weight of every feature. The weight vector of a feature in binary classification is given in the following equation:(5)Wi=Wi−xi−nearHiti2+xi−nearMissi2,where nearHit is the nearest same-class instance and nearMiss is the nearest different-class instance.The Manhattan (L1) distance is used to find the nearHit and nearMiss instances rather than the Euclidean (L2) distance used in a ReliefF algorithm. Furthermore, ReliefF algorithm updates weight vectors when considering the absolute differences betweenxi and nearHit rather than the square between xi and nearHit.Step 3: compute the feature importance to the target variable based on the weights using feature_importances_.Step 4: Considering the feature importance values, features having higher scores are selected for model development, indicating additional dependence on target variable. SelectKBest() is used to choose the ten features with the highest feature importance values; K denotes the number of features for model construction, as indicated in Table2.Step 5: after selecting the highest ten ranking features in Table2, the next step is to identify the ideal number of features (n) to be employed for each feature subset. We began the search method with a subset of n = 5 features, i.e., the five features having the highest feature importance values.Step 6: in the second iteration, another subset of features withn = 6 is produced by choosing the first six features with the greatest feature importance values. The same approach is used to rank features for n = 7, 8, 9, 10 to generate distinct feature subsets.(4) ANOVA Method. ANOVA (Analysis of Variance) is a statistical test that formulates the ratio between variances, such as the variance from two different samples. Furthermore, ANOVA is beneficial in classification; the data come up with numeric input and categorical target variables [11, 19]. The steps necessary to complete this process are listed below.Step 1: select all the features from the original dataset.Step 2: calculate the ANOVA F-scores between each feature and the target feature using f_classif() function that is in the scikit-learn machine library. Here, use the following formula to calculate the one-way ANOVA F-test.(6)F=variancebetweengroupsvariancewithingroups,variancebetweengroups=∑i=1nniY¯i−Y¯2K−1,variance withingroups=∑i=1K∑j=1niYij−Y¯i2N−K,whereY¯i is the ith group sample mean, ni is the number of observations in the ith group, Y¯ is the overall mean of the data, K is the number of groups, Yij is the jth observation in the ith out of K groups, and N is the overall sample size.Step 3: the score of this test is used to perform feature selection, which allows for the elimination of features that are not related to the target variable. SelectKBest() was used in this experiment to choose the most relevant top ten features with the lowest variance;K denotes the number of features we want in the final dataset. Table 2 lists the initial top ten features for model building.Step 4: after selecting the highest-ranking features in Table2, the ideal number of features (n) with the highest ANOVA F-scores to be used is determined to create various feature subsets.We began the search method with a subset ofn = 5 features, i.e., the five features with the highest ANOVA F-scores.Step 5: in the second iteration, a subset of features withn = 6 is formed by choosing the top six features with the greatest ANOVA F-scores. The same approach is used to rank features for n = 7, 8, 9, 10 to generate distinct feature subsets.


### 3.3.2. Feature Selection Using Wrapper Methods

This method mainly utilizes a search strategy to evaluate the variable subsets of independent featuresS'⊆S by feeding S′ to the chosen learning algorithm and then assessing the performance of a learning algorithm. When the cardinality of features in a dataset comes up with N, the 2N subsets are possible, and the steps are done iteratively before the required suboptimal subsets are found. Thus, the value of the cardinality is very high, and the number of subsets is exponential. The searching method can identify various types of techniques and in this experiment mainly used four types of techniques: forward feature selection, backward feature elimination, recursive feature elimination, and exhaustive feature selection described below [13, 14, 20, 21]. The parameter settings for the wrapper-based algorithms are included in Table 3.Table 3
Parameter settings for wrapper-based techniques.
TechniqueFeature selection functionParametersForward feature selectionsklearn.feature_selection.SequentialFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10, direction = 'forward',scoring = 'accuracy',cv = 5,n_jobs = -1Backward feature eliminationsklearn.feature_selection.SequentialFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10, direction = 'backward',scoring = 'accuracy',cv = 5,n_jobs = -1Recursive feature eliminationsklearn.feature_selection.RFE()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10,step = 1,verbose = 2Exhaustive feature selectionmlxtend.feature_selection.ExhaustiveFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),min_features = 4,max_features = 5/6/7/8/9/10, scoring = 'accuracy', cv = 5,n_jobs = -1(1) Forward Feature Selection (FFS). Forward feature selection is an iterative procedure that begins with the feature having the highest performance versus the target feature. When selecting the feature subset, with support vector machine used as a learning algorithm, stratification is required to guarantee that each class is well represented [4]. Each subset is evaluated independently, and the creation of subsets is determined by the search method. The following are the steps required to complete the feature selection procedure.Step 1: all the features were selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 for then_features_to_select parameter.Step 3: the process starts with adding one feature that obtained a higher cross-validation score. Then, after iteration, choose another feature that optimally performs when combined with the initially selected feature. This procedure is repeated until reaching the desired number of features to be chosen.Step 4: select the optimal feature subset according to the highest average score of the classifier in Step 3.Step 5: steps 2 and 3 are repeated by changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(2) Backward Feature Elimination (BFE). The approach of backward elimination is the complete opposite of the method of forward feature selection [4]. The following stages are followed to finish the feature selection procedure.Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 for then_features_to_select parameter.Step 3: the process begins by assembling all accessible features into a model. Following that, each iteration eliminates the least significant feature, thereby improving the performance of the model. This method is continued until the desired number of characteristics available for selection is reached.Step 4: select the optimal feature subset according to the highest average score of the classifier in Step 3.Step 5: steps 2 and 3 are repeated by changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(3) Recursive Feature Elimination (RFE). Recursive feature elimination uses an approach to iteratively train the model, removing the least significant feature using the algorithm's weights as a criterion for each iteration. Recursive feature elimination aims to choose features by examining smaller and smaller sets of features in a recursive fashion. The following steps are used to complete the feature selection method [10, 21].Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 forn_features_to_select parameter.Step 3: at the beginning, the estimator is trained on the original set of features, and the significance of each feature is determined using either the coef_ or feature_importances_ attributes.Step 4: the least significant features in the current set of features are trimmed. This method is done repeatedly until the trimmed group has the required number of features to be selected.Step 5: steps 3 and 4 are repeated with changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(4) Exhaustive Feature Selection (EFS). When determining the optimum feature subset, the exhaustive feature selection approach used brute-force strategies. The performance of the machine learning algorithm is assessed against all potential feature combinations in the dataset. The optimum feature subset is determined by the one that produces the best performance. The exhaustive search algorithm is the greediest algorithm of the wrapper techniques since it attempts all possible combinations of features and chooses the best [11]. The disadvantage of exhaustive feature selection is that it is slower than the step forward and step backward approach since it examines all possible feature combinations [11]. The steps to select the optimal feature subset using EFS are outlined below.Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the min_features as one and max_features as 5.Step 3: the performance of the machine learning algorithm is assessed against all potential feature combinations in the dataset. The optimum feature subset is determined by the one that produces the best performance. The exhaustive search algorithm is the greediest algorithm of the wrapper techniques since it attempts all possible combinations of features and chooses the best.Step 4: step 3 is repeated by changing the value of max_features to 6, 7, 8, 9, 10, respectively.Step 5: using Step 4, the optimal feature subsets for the number of features assigned in Step 4 are identified.


### 3.3.3. Feature Selection Using Embedded Methods

Embedded techniques include integrating the feature selection process into the machine learning algorithm's development. This is a hybrid technique that combines the filter and wrapper methods. Here, the algorithms include their feature selection strategy. These contribute to the generation of the optimal subset and offer it to the training model. In other words, they pick features during model training, which is why they are referred to as embedded techniques. These techniques need less computation than wrapper methods. The design of embedded feature selection approaches is algorithm dependent. However, developing a mathematical model for a feature selection embedded classifier is quite difficult [13,14,20].(1) Lasso Regression. The abbreviation “Lasso” refers to the Least Absolute Selection and Shrinkage Operator. In Lasso, the penalty is defined as the total of the absolute values of the coefficients, which is L1. Thus, the primary goal of Lasso is to reduce an absolute value (L1 penalty) to zero rather than to use the sum of squares (L2 penalty) [18, 22]. The following steps explain the procedures of selecting the optimum feature subset using Lasso.Step 1: all the features are selected from the original dataset.Step 2: make a pipeline object using StandardScaler and Lasso in scikit-learn.Step 3: optimize theα hyperparameter that tunes the intensity of Lasso regression using several values from 0.1 to 10 with 0.1 steps.Step 4: calculate the mean squared error on a fivefold cross-validation basis and choose the value that minimizes such average performance metrics.Step 5: get the absolute values of the magnitude of the coefficients of the Lasso regression. Select the feature that takes nonzero value for the best feature subset.(2) Ridge Regression. Ridge regression employs L2, with the penalty equal to the sum of the squares of the coefficients of the variables. This form of regression aids in the reduction of variation caused by variable multicollinearity. It contributes to the removal of variation caused by nonlinear correlations between two independent variables [18]. The following steps describe how to use Ridge to choose the optimal feature subset.Step 1: all the features are selected from the original dataset.Step 2: create a pipeline object in scikit-learn using StandardScaler and Ridge.Step 3: optimize the alpha hyperparameter that tunes the Ridge regression's intensity using multiple values ranging from 0.1 to 10 with a 0.1 step.Step 4: using fivefold cross-validation, calculate the mean squared error and select the value that minimizes such average performance metrics.Step 5: calculate the Ridge regression's squared coefficients. For the best feature subset, select the features that have a nonzero value.


## 3.3.1. Feature Selection Using Filter Methods

Filter-based selection techniques utilize statistical methods to determine the dependence or association among independent features (input attributes) and the dependent feature (target attribute).In filter method, without depending on any learning algorithms, features are assessed based on the general properties of the data as represented in Figure3. On the other hand, characteristics are chosen based on the output results/scores generated by the various statistical methods used to validate them.Figure 3
Summary of features selected by feature selection algorithms.It primarily quantifies the properties of features using distinct types of measurement criteria, including information, distance, dependence, consistency, similarity, and statistical measures. These attributes are compared for their interdependence with the output attribute to choose the appropriate subset [13–16].This proposed work mainly uses four filter-based feature selection algorithms, namely, Chi-square, mutual information, ReliefF, and ANOVA F method.(1) Chi-Square. The Chi-square test follows the univariate statistical approach in feature selection to identify the dependence of each feature (or correlation) with the target variable in a dataset [8]. Here, remove the features independent of the target variable and other dependent features considered highly important to predict the target variable. The steps involved in this process are given as follows.Step 1: select all the features from the original dataset.Step 2: calculate the Chi-square scores to determine the independence of two features using chi2() function that is in the scikit-learn machine library. Here, use (1) to determine the Chi-square score for each feature given as follows.(1)X2=∑fO−fE2fE,wherefO is the observer frequency and fE is the expected frequency.The observed frequency is close to the expected frequency, resulting in a lower Chi-square score when two features are independent.Step 3: the feature with a larger Chi-square value relies more on the target feature and is thus chosen for model construction. SelectKBest() was used to select the ten features with the highest Chi-square score shown in Table2; K denotes the number of features to be included in the final dataset.Step 4: based on the top ten ranking features in Table2, the next step is needed to select a threshold to create subsets for the number of features represented by n, i.e., the optimum number of features with the highest Chi test score to be utilized. During the search process, start with a subset of features with n = 5, i.e., only five features with the highest Chi test score, to create the initial feature subset.Step 5: in the second iteration, another subset of features withn = 6 is generated by picking the first six features with the greatest Chi score. The same procedure is performed with n = 7, 8, 9, 10 for ranking features to create distinct feature subsets.Table 2
Ranking order of features based on filter-based techniques.
RankANOVAChi-squareMutual informationRelief1F13F8F13F132F12F12F12F123F10F10F9F94F9F13F3F105F8F5F10F36F3F9F8F107F11F1F11F88F2F4F5F29F1F3F6F110F7F7F2F711F5F2F1F512F4F11F7F413F6F6F4F6(2) Mutual Information. The mutual information (MI) between two random variables is a metric measuring their interdependence or measures the reduction in uncertainty. The actions necessary to complete this process are listed below.Step 1: select all the features from the original dataset.Step 2: calculate mutual information scores to determine the relationship between the features and the target feature using the mutual_info_classif() function. When calculating mutual information scores, the following steps and formulas are used.In predicting the unknown class of samples, entropy and conditional entropy principles can be used to assess a given feature's efficiency [15, 17, 18]. The entropy of H (X) for the values {x1, x2,..., xn} can be given as(2)HX=−∑i=1npxilog2pxi,wherepxi means probability mass function of xi.The conditional entropy for the two discreteX and Y random variables is given as(3)HX|Y=−∑i=1n∑j=1nPxi,yjlog2PxiPxi,yj,wherep (xi, yj) is X = xi and Y = yj joint probability.The mutual information [MI (X; Y)] of the respective variables X and Y can be computed in terms of both the entropy of X, H (X) and the conditional entropy H (C|X) as(4)MIX:Y=HX−HX|Y.Step 3: a higher score indicates the presence of additional dependence on target variable. SelectKBest() was used to choose the ten features with the highest mutual information scores for model construction, as indicated in Table2.Step 4: considering the best ten ranking features in Table2, the next step is to determine the optimal number of features (n) with the highest mutual information scores to be used for feature subsets. During the search procedure, we began with a subset of features with n = 5, i.e., the five features with the greatest mutual information scores.Step 5: another subset of features withn = 6 is created in the second iteration by selecting the first six features with the highest mutual information scores. For n = 7, 8, 9, 10, the same technique is used to rank features to produce separate feature subsets.(3) ReliefF Algorithm. The ReliefF is a supervised feature learning approach to weigh each feature, demonstrating its importance to the target variable used for binary and multiclass problem domains. The steps required to accomplish this procedure are summarized below.Step 1: select all the features from the original dataset.Step 2: calculate the weight of each feature using the ReliefF() function. The weight is defined by the closest neighbor of the same class and different classes [6, 9, 12]. The sample instance compared the values of the nearest neighbor features and modified the weight of every feature. The weight vector of a feature in binary classification is given in the following equation:(5)Wi=Wi−xi−nearHiti2+xi−nearMissi2,where nearHit is the nearest same-class instance and nearMiss is the nearest different-class instance.The Manhattan (L1) distance is used to find the nearHit and nearMiss instances rather than the Euclidean (L2) distance used in a ReliefF algorithm. Furthermore, ReliefF algorithm updates weight vectors when considering the absolute differences betweenxi and nearHit rather than the square between xi and nearHit.Step 3: compute the feature importance to the target variable based on the weights using feature_importances_.Step 4: Considering the feature importance values, features having higher scores are selected for model development, indicating additional dependence on target variable. SelectKBest() is used to choose the ten features with the highest feature importance values; K denotes the number of features for model construction, as indicated in Table2.Step 5: after selecting the highest ten ranking features in Table2, the next step is to identify the ideal number of features (n) to be employed for each feature subset. We began the search method with a subset of n = 5 features, i.e., the five features having the highest feature importance values.Step 6: in the second iteration, another subset of features withn = 6 is produced by choosing the first six features with the greatest feature importance values. The same approach is used to rank features for n = 7, 8, 9, 10 to generate distinct feature subsets.(4) ANOVA Method. ANOVA (Analysis of Variance) is a statistical test that formulates the ratio between variances, such as the variance from two different samples. Furthermore, ANOVA is beneficial in classification; the data come up with numeric input and categorical target variables [11, 19]. The steps necessary to complete this process are listed below.Step 1: select all the features from the original dataset.Step 2: calculate the ANOVA F-scores between each feature and the target feature using f_classif() function that is in the scikit-learn machine library. Here, use the following formula to calculate the one-way ANOVA F-test.(6)F=variancebetweengroupsvariancewithingroups,variancebetweengroups=∑i=1nniY¯i−Y¯2K−1,variance withingroups=∑i=1K∑j=1niYij−Y¯i2N−K,whereY¯i is the ith group sample mean, ni is the number of observations in the ith group, Y¯ is the overall mean of the data, K is the number of groups, Yij is the jth observation in the ith out of K groups, and N is the overall sample size.Step 3: the score of this test is used to perform feature selection, which allows for the elimination of features that are not related to the target variable. SelectKBest() was used in this experiment to choose the most relevant top ten features with the lowest variance;K denotes the number of features we want in the final dataset. Table 2 lists the initial top ten features for model building.Step 4: after selecting the highest-ranking features in Table2, the ideal number of features (n) with the highest ANOVA F-scores to be used is determined to create various feature subsets.We began the search method with a subset ofn = 5 features, i.e., the five features with the highest ANOVA F-scores.Step 5: in the second iteration, a subset of features withn = 6 is formed by choosing the top six features with the greatest ANOVA F-scores. The same approach is used to rank features for n = 7, 8, 9, 10 to generate distinct feature subsets.


## 3.3.2. Feature Selection Using Wrapper Methods

This method mainly utilizes a search strategy to evaluate the variable subsets of independent featuresS'⊆S by feeding S′ to the chosen learning algorithm and then assessing the performance of a learning algorithm. When the cardinality of features in a dataset comes up with N, the 2N subsets are possible, and the steps are done iteratively before the required suboptimal subsets are found. Thus, the value of the cardinality is very high, and the number of subsets is exponential. The searching method can identify various types of techniques and in this experiment mainly used four types of techniques: forward feature selection, backward feature elimination, recursive feature elimination, and exhaustive feature selection described below [13, 14, 20, 21]. The parameter settings for the wrapper-based algorithms are included in Table 3.Table 3
Parameter settings for wrapper-based techniques.
TechniqueFeature selection functionParametersForward feature selectionsklearn.feature_selection.SequentialFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10, direction = 'forward',scoring = 'accuracy',cv = 5,n_jobs = -1Backward feature eliminationsklearn.feature_selection.SequentialFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10, direction = 'backward',scoring = 'accuracy',cv = 5,n_jobs = -1Recursive feature eliminationsklearn.feature_selection.RFE()svm.SVC (kernel = 'linear', degree = 2),n_features_to_select = 5/6/7/8/9/10,step = 1,verbose = 2Exhaustive feature selectionmlxtend.feature_selection.ExhaustiveFeatureSelector()svm.SVC (kernel = 'linear', degree = 2),min_features = 4,max_features = 5/6/7/8/9/10, scoring = 'accuracy', cv = 5,n_jobs = -1(1) Forward Feature Selection (FFS). Forward feature selection is an iterative procedure that begins with the feature having the highest performance versus the target feature. When selecting the feature subset, with support vector machine used as a learning algorithm, stratification is required to guarantee that each class is well represented [4]. Each subset is evaluated independently, and the creation of subsets is determined by the search method. The following are the steps required to complete the feature selection procedure.Step 1: all the features were selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 for then_features_to_select parameter.Step 3: the process starts with adding one feature that obtained a higher cross-validation score. Then, after iteration, choose another feature that optimally performs when combined with the initially selected feature. This procedure is repeated until reaching the desired number of features to be chosen.Step 4: select the optimal feature subset according to the highest average score of the classifier in Step 3.Step 5: steps 2 and 3 are repeated by changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(2) Backward Feature Elimination (BFE). The approach of backward elimination is the complete opposite of the method of forward feature selection [4]. The following stages are followed to finish the feature selection procedure.Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 for then_features_to_select parameter.Step 3: the process begins by assembling all accessible features into a model. Following that, each iteration eliminates the least significant feature, thereby improving the performance of the model. This method is continued until the desired number of characteristics available for selection is reached.Step 4: select the optimal feature subset according to the highest average score of the classifier in Step 3.Step 5: steps 2 and 3 are repeated by changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(3) Recursive Feature Elimination (RFE). Recursive feature elimination uses an approach to iteratively train the model, removing the least significant feature using the algorithm's weights as a criterion for each iteration. Recursive feature elimination aims to choose features by examining smaller and smaller sets of features in a recursive fashion. The following steps are used to complete the feature selection method [10, 21].Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the value as 5 forn_features_to_select parameter.Step 3: at the beginning, the estimator is trained on the original set of features, and the significance of each feature is determined using either the coef_ or feature_importances_ attributes.Step 4: the least significant features in the current set of features are trimmed. This method is done repeatedly until the trimmed group has the required number of features to be selected.Step 5: steps 3 and 4 are repeated with changing the value ofn_features_to_select to 6, 7, 8, 9, 10, respectively.Step 6: using Step 4, the optimal feature subsets for the number of features assigned in Step 5 are identified.(4) Exhaustive Feature Selection (EFS). When determining the optimum feature subset, the exhaustive feature selection approach used brute-force strategies. The performance of the machine learning algorithm is assessed against all potential feature combinations in the dataset. The optimum feature subset is determined by the one that produces the best performance. The exhaustive search algorithm is the greediest algorithm of the wrapper techniques since it attempts all possible combinations of features and chooses the best [11]. The disadvantage of exhaustive feature selection is that it is slower than the step forward and step backward approach since it examines all possible feature combinations [11]. The steps to select the optimal feature subset using EFS are outlined below.Step 1: all the features are selected from the original dataset.Step 2: start the feature selection process by initializing the min_features as one and max_features as 5.Step 3: the performance of the machine learning algorithm is assessed against all potential feature combinations in the dataset. The optimum feature subset is determined by the one that produces the best performance. The exhaustive search algorithm is the greediest algorithm of the wrapper techniques since it attempts all possible combinations of features and chooses the best.Step 4: step 3 is repeated by changing the value of max_features to 6, 7, 8, 9, 10, respectively.Step 5: using Step 4, the optimal feature subsets for the number of features assigned in Step 4 are identified.


## 3.3.3. Feature Selection Using Embedded Methods

Embedded techniques include integrating the feature selection process into the machine learning algorithm's development. This is a hybrid technique that combines the filter and wrapper methods. Here, the algorithms include their feature selection strategy. These contribute to the generation of the optimal subset and offer it to the training model. In other words, they pick features during model training, which is why they are referred to as embedded techniques. These techniques need less computation than wrapper methods. The design of embedded feature selection approaches is algorithm dependent. However, developing a mathematical model for a feature selection embedded classifier is quite difficult [13,14,20].(1) Lasso Regression. The abbreviation “Lasso” refers to the Least Absolute Selection and Shrinkage Operator. In Lasso, the penalty is defined as the total of the absolute values of the coefficients, which is L1. Thus, the primary goal of Lasso is to reduce an absolute value (L1 penalty) to zero rather than to use the sum of squares (L2 penalty) [18, 22]. The following steps explain the procedures of selecting the optimum feature subset using Lasso.Step 1: all the features are selected from the original dataset.Step 2: make a pipeline object using StandardScaler and Lasso in scikit-learn.Step 3: optimize theα hyperparameter that tunes the intensity of Lasso regression using several values from 0.1 to 10 with 0.1 steps.Step 4: calculate the mean squared error on a fivefold cross-validation basis and choose the value that minimizes such average performance metrics.Step 5: get the absolute values of the magnitude of the coefficients of the Lasso regression. Select the feature that takes nonzero value for the best feature subset.(2) Ridge Regression. Ridge regression employs L2, with the penalty equal to the sum of the squares of the coefficients of the variables. This form of regression aids in the reduction of variation caused by variable multicollinearity. It contributes to the removal of variation caused by nonlinear correlations between two independent variables [18]. The following steps describe how to use Ridge to choose the optimal feature subset.Step 1: all the features are selected from the original dataset.Step 2: create a pipeline object in scikit-learn using StandardScaler and Ridge.Step 3: optimize the alpha hyperparameter that tunes the Ridge regression's intensity using multiple values ranging from 0.1 to 10 with a 0.1 step.Step 4: using fivefold cross-validation, calculate the mean squared error and select the value that minimizes such average performance metrics.Step 5: calculate the Ridge regression's squared coefficients. For the best feature subset, select the features that have a nonzero value.


## 3.4. Data Splitting

The heart disease dataset is split into an 80% training set and a 20% testing set in this phase. The training set was used to develop the models, while the testing set was used to assess them. Additionally, a 10-fold cross-validation technique was used for validating the training phase of the classifier.


## 3.5. Training Models

Classification is a method for labeling a particular set of data with different classes, which is carried out on structured and unstructured data. The aim of classification predictive modeling is to approximate mapping between input variables and discrete output variables. There are several classification algorithms available, but one that is better than another cannot be concluded. This relies on the domain of the problem and the nature of the dataset available [10].In this analysis, we used six different supervised learning algorithms, which are decision tree, random forest, support vector machine, K- nearest neighbor, logistic regression, and Gaussian naive Bayes.


### 3.5.1. Support Vector Machines (SVM)

This classifier showed great empirical successes in classification tasks under supervised machine learning techniques. It separates data into different classes by a hyperplane or hyperplanes since it can handle multidimensional data. SVM separates data into hyperplanes with the help of the following mathematical formulas:(7)positive hyperlane:wTx+b=+1,(8)optimal hyperlane:wTx+b=0,(9)negative hyperlane:wTx+b=+1,where x is the vector point and w is the weight vector.SVMs minimize the error in empirical classification and optimize the classification margin. SVM models can be categorized into four distinct categories, according to the error function method: Nu-SVM regression, C-SVM classification, Nu-SVM classification, and Epsilon-SVM regression. Support vector machine algorithm is deployed with kernel functions such as radial basis, polynomial, linear, and sigmoid kernels, which convert nonlinear data map to the linear form [2, 4, 10]. In this experiment, linear kernel function is used for classification.


### 3.5.2. Decision Tree (DT)

A decision tree algorithm can be categorized under supervised learning, which is identical to a tree of nodes and edges ideal for classification problems. Every node in the tree represents the class of the problem, and every edge indicates the choice made based on the evaluated results. This classifier can be considered a predictive machine learning model that displays the correlation between dataset values and features. Each division in the decision tree indicates the potential value for a certain category. Dependent on entropy measurements of the dataset attributes, the nodes are identified. The maximum entropy value attribute is known to be the root node. C4.5, Iterative Dichotomiser 3(ID3), and Classification and Regression Trees (CART) are widely used decision tree models [2, 4, 10].


### 3.5.3. Random Forest (RF)

One of the most widely used, technologically advanced, supervised ensemble classification methods is called random forest. It generates a large number of trees during the training stage and builds a forest of decision trees on multiple data subsets. At the testing stage, each tree in the forest assigns each piece of data a class label. When each tree predicts a class label, the ultimate determination for each set of test data is made by a majority vote. Whichever class label receives the greatest number of votes is assumed to be the right label for the test data to enhance its prediction accuracy. This procedure is performed for each piece of data in the dataset [2, 10].


### 3.5.4. K-Nearest Neighbor (KNN)

K-nearest neighbor is a technique of supervised learning used to recognize the patterns in the dataset and determine the belonging class based on the points of existence with the nearest neighbors. It determines the class of instance by considering the distance from the nearest neighbor and consistency. KNN uses different distance functions such as Manhattan, Euclidean, Hamming, and Minkowski when identifying the neighbor's points. This method is called a memory dependent approach because all the instance points are stored inside the memory [2, 4, 10]. The weight is allocated for each point depending on the distance from each instance to improve the algorithm's performance. The following equation is used to calculate the Euclidean distance:(10)D=∑i=1nxi−yi2.


### 3.5.5. Logistic Regression (LR)

Logistic regression is a widely used machine learning method that falls into the category of supervised learning. It is used to forecast a categorical dependent variable based on a set of independent variables. For example, it is used to extract significant statistical items from the model or forecast the tendency of data [2, 18]. The dependent variable in logistic regression is a binary variable that contains data coded as 1 (yes, success, etc.) or 0 (no, failure, etc.). The logistic regression algorithm is based on the logistic function shown below:(11)PX=11+e−fx,where f(x) is a function consisting of features (xk) and their corresponding weights/coefficients (βk) in a linear form shown as below:(12)fx=x0+x1β1+…+xkβk+ε,where x, β, f(x)∈Rk and ε represents the random error process noise inevitably happening in the data generating process. The sigmoid function is a mathematical function that converts linear regression to logistic regression. It converts any real number to another value between 0 and 1.


### 3.5.6. Gaussian Naive Bayes (GNB)

This algorithm, based on the theorem of Bayes, expects independence between two variables. The construction of a Bayesian model is simple and particularly realistic, based on the massive datasets. Naive Bayes' simplicity and dominance over complex approaches are well established [2, 8].Gaussian naive Byes is used when all of the data values of a dataset are numeric. The probability density function is defined using the mean and standard deviation. Next, it computes the mean and standard deviation for each of the dataset's features. After computing this, the probabilities for each test data pattern are calculated using the mean and standard deviation when any test data pattern occurs. Finally, it assigns an appropriate class label to the test data whose probability is near to 1. The following equation is used to determine the likelihood.(13)Pxi|y=12πσy2exp−xi−μy22σy2,where μy is the mean and σy is the standard deviation.The parameter setting of the learning algorithms is described in Table4.Table 4
Parameter settings for classifier.
Classification algorithmBasic parametersRandom forest (RF)n_estimators = 100, random_state = 0, n_jobs = -1Support vector machine (SVM)kernel = “linear”, degree = 2Decision tree (DT)Criterion = “gini”, splitter = “best”, random_state = 0K-nearest neighbor (KNN)n_neighbors = 4, weights = “distance”,n_jobs = -1Logistic regression (LR)C = 1, penalty = “l1/l2”, solver = “liblinear”, random_state = 7Gaussian naive Bayesvar_smoothing = 0.05


## 3.5.1. Support Vector Machines (SVM)

This classifier showed great empirical successes in classification tasks under supervised machine learning techniques. It separates data into different classes by a hyperplane or hyperplanes since it can handle multidimensional data. SVM separates data into hyperplanes with the help of the following mathematical formulas:(7)positive hyperlane:wTx+b=+1,(8)optimal hyperlane:wTx+b=0,(9)negative hyperlane:wTx+b=+1,where x is the vector point and w is the weight vector.SVMs minimize the error in empirical classification and optimize the classification margin. SVM models can be categorized into four distinct categories, according to the error function method: Nu-SVM regression, C-SVM classification, Nu-SVM classification, and Epsilon-SVM regression. Support vector machine algorithm is deployed with kernel functions such as radial basis, polynomial, linear, and sigmoid kernels, which convert nonlinear data map to the linear form [2, 4, 10]. In this experiment, linear kernel function is used for classification.


## 3.5.2. Decision Tree (DT)

A decision tree algorithm can be categorized under supervised learning, which is identical to a tree of nodes and edges ideal for classification problems. Every node in the tree represents the class of the problem, and every edge indicates the choice made based on the evaluated results. This classifier can be considered a predictive machine learning model that displays the correlation between dataset values and features. Each division in the decision tree indicates the potential value for a certain category. Dependent on entropy measurements of the dataset attributes, the nodes are identified. The maximum entropy value attribute is known to be the root node. C4.5, Iterative Dichotomiser 3(ID3), and Classification and Regression Trees (CART) are widely used decision tree models [2, 4, 10].


## 3.5.3. Random Forest (RF)

One of the most widely used, technologically advanced, supervised ensemble classification methods is called random forest. It generates a large number of trees during the training stage and builds a forest of decision trees on multiple data subsets. At the testing stage, each tree in the forest assigns each piece of data a class label. When each tree predicts a class label, the ultimate determination for each set of test data is made by a majority vote. Whichever class label receives the greatest number of votes is assumed to be the right label for the test data to enhance its prediction accuracy. This procedure is performed for each piece of data in the dataset [2, 10].


## 3.5.4. K-Nearest Neighbor (KNN)

K-nearest neighbor is a technique of supervised learning used to recognize the patterns in the dataset and determine the belonging class based on the points of existence with the nearest neighbors. It determines the class of instance by considering the distance from the nearest neighbor and consistency. KNN uses different distance functions such as Manhattan, Euclidean, Hamming, and Minkowski when identifying the neighbor's points. This method is called a memory dependent approach because all the instance points are stored inside the memory [2, 4, 10]. The weight is allocated for each point depending on the distance from each instance to improve the algorithm's performance. The following equation is used to calculate the Euclidean distance:(10)D=∑i=1nxi−yi2.


## 3.5.5. Logistic Regression (LR)

Logistic regression is a widely used machine learning method that falls into the category of supervised learning. It is used to forecast a categorical dependent variable based on a set of independent variables. For example, it is used to extract significant statistical items from the model or forecast the tendency of data [2, 18]. The dependent variable in logistic regression is a binary variable that contains data coded as 1 (yes, success, etc.) or 0 (no, failure, etc.). The logistic regression algorithm is based on the logistic function shown below:(11)PX=11+e−fx,where f(x) is a function consisting of features (xk) and their corresponding weights/coefficients (βk) in a linear form shown as below:(12)fx=x0+x1β1+…+xkβk+ε,where x, β, f(x)∈Rk and ε represents the random error process noise inevitably happening in the data generating process. The sigmoid function is a mathematical function that converts linear regression to logistic regression. It converts any real number to another value between 0 and 1.


## 3.5.6. Gaussian Naive Bayes (GNB)

This algorithm, based on the theorem of Bayes, expects independence between two variables. The construction of a Bayesian model is simple and particularly realistic, based on the massive datasets. Naive Bayes' simplicity and dominance over complex approaches are well established [2, 8].Gaussian naive Byes is used when all of the data values of a dataset are numeric. The probability density function is defined using the mean and standard deviation. Next, it computes the mean and standard deviation for each of the dataset's features. After computing this, the probabilities for each test data pattern are calculated using the mean and standard deviation when any test data pattern occurs. Finally, it assigns an appropriate class label to the test data whose probability is near to 1. The following equation is used to determine the likelihood.(13)Pxi|y=12πσy2exp−xi−μy22σy2,where μy is the mean and σy is the standard deviation.The parameter setting of the learning algorithms is described in Table4.Table 4
Parameter settings for classifier.
Classification algorithmBasic parametersRandom forest (RF)n_estimators = 100, random_state = 0, n_jobs = -1Support vector machine (SVM)kernel = “linear”, degree = 2Decision tree (DT)Criterion = “gini”, splitter = “best”, random_state = 0K-nearest neighbor (KNN)n_neighbors = 4, weights = “distance”,n_jobs = -1Logistic regression (LR)C = 1, penalty = “l1/l2”, solver = “liblinear”, random_state = 7Gaussian naive Bayesvar_smoothing = 0.05


## 3.6. Evaluating Models

Various assessment metrics are applied to determine the efficiency of the feature selection techniques in this study, namely, precision, F1-score, accuracy, and recall, with the help of elements in the confusion matrix. The confusion matrix allows researchers to identify the performance rate of the result in classification problems depending on four main factors: True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN).The accuracy will be shown by the model if it can raise proper identification of high risk level of getting heart disease. Accuracy can be calculated by(14)accuracy=TP+TNTP+TN+FP+FN.Precision, calculated as a summation of correctly identified instances, means that the proportion of patients diagnosed with heart disease actually had risk. Precision is given by(15)precision=TPTP+FP.Recall is the measure which indicates that the algorithm diagnosed the proportion of patients that actually had heart disease as having disease and is defined by(16)recall  or sensitivity=TPTP+FN.F-score computes the accuracy of the test, and the formula used to evaluate it is(17)F−measure=2×precision×recallprecision+recall.


## 4. Results and Discussion

Python was used as the programming language in this comparative analysis process to build the analytical model on Jupyter (Anaconda) Notebook. This provides benefits to the dataset exploration and allows effective pattern identification. In addition, scikit-feature has been designed by Arizona State University and is one of the most comprehensive open source feature selection libraries in Python, which includes around 40 feature selection algorithms used in development.The Cleveland heart disease dataset gathered from the UCI ML Repository contains 303 samples: 164 samples indicate the absence of heart disease, and 139 samples indicate the presence of heart disease. The optimal feature subsets for classification were selected by using ten feature selection algorithms, namely, Chi-square, ANOVA, mutual information, Relief, forward feature selection (FFS), backward feature selection (BFS), exhaustive feature selection (EFS), recursive feature elimination (RFE), Lasso (L1) regression, and Ridge (L2) regression categorized under the filter, wrapper, and embedded methods. The performance is evaluated using six classifiers: random forest, support vector machine, decision tree, K- nearest neighbor, logistic regression, and Gaussian naive Bayes.


### 4.1. Feature Selection Result

Table5 shows the reduced feature subsets using different feature selection algorithms. Each feature in the table is denoted by values of 1 or 0. If the feature appears in the feature subset, it is denoted by 1; otherwise, it is denoted by 0 in accordance with the following attribute sequence.Table 5
Reduced feature subsets using filter, wrapper, and embedded methods.
Feature selection methodFeaturesSize of feature subsetF1F2F3F4F5F6F7F8F9F10F11F12F13ANOVA00100001110116001000011111170110000111111811100001111119111000111111110Chi-square00001001110116100010011101171001100111011810111001110119101110111101110Mutual information00100001110116001000011111170010100111111800101101111119011011011111110Relief00100000111116001000011111170110000111111811100001111119111000111111110Forward feature selection (FFS)1010000000011411100000000115111000010001161010100101011710111011010119Backward feature selection (BFS)0110001010011610111011010108110011110110191011101011011910111011010119Exhaustive feature selection (EFS)00000000100113001000001001140010100110011601101001010117111110111001110Recursive feature elimination (RFE)0110000010110501100000101116011000101011170110001011111801100110111119Lasso (L1)111110111101111Ridge (L2)01100010100105According to the statistics in Figure3, the most significant feature for predicting heart disease is F12, followed by F13, F3, F9, and F10; nevertheless, these features are ordered across feature selection methods.


### 4.2. Classification Result

The accuracies obtained by the analysis, on the Cleveland heart datasets, of the different feature subsets selected by filter, wrapper, and embedded methods are shown in Figures4–6.Figure 4
Classification accuracies of reduced feature subsets using filter-based methods with RF, SVM, DT, KNN, LR, and GNB (NOF: number of features, IFS: initial feature set, ANOVA: ANOVA method, CHI: Chi-square, MI: mutual information, RELIEF: Relief method).Figure 5
Classification accuracies of reduced feature subsets using wrapper-based methods with RF, SVM, DT, KNN, LR, and GNB (NOF: number of features, IFS: initial feature set, FFS: forward feature selection, BFS: backward feature selection, EFS: exhaustive feature selection, RFE: recursive feature selection).Figure 6
Classification accuracies of reduced feature subsets using wrapper-based methods with RF, SVM, DT, KNN, LR, and GNB (NOF: number of features, IFS: initial feature set, Lasso: Lasso regression, Ridge: ridge regression).Figure5 summarizes the heart disease prediction accuracies using the optimal feature set identified by ANOVA, Chi-square, mutual information, and Relief techniques on various learning algorithms.The classification accuracies of the feature set identified by FFS, BFS, EFS, and RFE techniques categorized under the wrapper-based methods are presented in Figure5. The accuracies of embedded feature selectors with learning algorithms are illustrated in Figure 6.According to the result obtained by the analysis, all models constructed from the selected feature subsets utilizing a variety of different feature selection approaches outperform the original dataset feature subsets. The original feature set has achieved maximum accuracy of 63.92%, precision of 58.33%, sensitivity of 53.84%, and f-measure of 55.99% with the KNN classifier. After applying all feature selection approaches, the accuracy of the classifiers significantly improved.Table6 summarizes the best accuracy performance of each feature selection technique. The feature subset selected by the backward feature selection technique has achieved the highest classification accuracy of 88.52%, precision of 91.30%, sensitivity of 80.76%, and f-measure of 85.71% with the DT classifier. The selected features are F2, F3, F7, F9, F12, and F13.Table 6
Performance measure of best-reduced feature subsets using the filter, wrapper, and embedded methods.
Feature selection techniquesNumber of featuresPrecisionSensitivityF-measureRFSVMDTKNNLRGNBRFSVMDTKNNLRGNBRFSVMDTKNNLRGNBIFS1342.8535.0050.0058.3335.7130.0034.6126.9238.4653.8438.4611.5338.2930.4343.4755.9937.0316.66ANOVA680.9589.4771.4288.2389.4768.7565.3865.3857.6957.6965.3842.3072.3475.5563.8269.7675.5552.38784.2189.4769.5687.5090.0068.7561.5365.3861.5353.8469.2342.3071.1175.5565.3066.6678.2652.38894.4489.4768.1893.3390.0070.5865.3865.3857.6953.8469.2346.1577.2775.5562.4968.2978.2655.81980.9589.4770.8368.7585.7170.5865.3865.3865.3842.3069.2346.1572.3475.5568.0052.3876.5955.811085.0089.4770.0070.5885.0070.5865.3865.3853.8446.1565.3846.1573.9175.5560.8655.8173.9155.81Chi671.4280.0064.7059.2580.9556.2557.6961.5342.3061.5365.3834.6163.8269.5651.1660.3772.3442.85771.4280.0061.5351.8577.2760.0057.6961.5361.5353.8465.3846.1563.8269.5661.5352.8370.8352.17877.2777.2768.1856.6672.7257.8965.3865.3857.6965.3861.5342.3070.8370.8362.4960.7166.6648.88984.2184.2182.6058.6276.1957.8961.5361.5373.0765.3861.5342.3071.1171.1177.5561.8168.0848.801084.2184.2182.6058.6277.2757.8961.5361.5373.0765.3865.3842.3071.1171.1177.5561.8170.8348.80MI685.0089.4771.4288.2389.4768.7565.3865.3857.6957.6965.3842.3073.9175.5563.8269.7675.5552.38788.8889.4769.5687.5090.0068.7561.5365.3861.5353.8469.2342.3072.7275.5565.3066.6678.2652.38880.0085.0066.6659.2585.7152.9461.5365.3853.8461.5369.2334.6169.5673.9159.5760.3776.5941.86985.0085.0064.0059.2585.7152.9465.3865.3861.5361.5369.2334.6173.9173.9162.7460.3776.5941.861080.9585.0069.2359.2581.8152.9465.3865.3869.2361.5369.2334.6172.3473.9169.2360.3775.0041.86Relief684.2189.4775.0072.7285.0083.3361.5365.3857.6961.5365.3857.6971.1175.5565.2166.6673.9168.18788.8889.4769.5687.5090.0068.7561.5365.3861.5353.8469.2342.3072.7275.5565.3066.6678.2652.38894.1189.4772.7293.3390.0070.5861.5365.3861.5353.8469.2346.1574.4175.5566.6668.2978.2655.81983.3389.4768.1868.7585.7170.5857.6965.3857.6942.3069.2346.1568.1875.5562.4952.3876.5955.811085.0089.4772.7270.5885.0070.5865.3865.3861.5346.1565.3846.1573.9175.5566.6655.8173.9155.81FFS483.6082.3585.0088.8882.3581.2873.0753.8465.3861.5353.8450.0079.1665.1173.9172.7265.1161.90586.9582.3584.0088.8884.2181.2576.9253.8480.7661.5361.5350.0081.6365.1182.3572.7271.1161.90686.3689.4778.5763.6390.0070.5873.0765.3884.6153.8469.2346.1579.1675.5581.4858.3378.2655.81780.0084.2168.1850.0085.7160.0061.5361.5357.6953.8469.2346.1569.5671.1164.4951.8576.5952.17988.8885.0090.4758.6280.9557.8961.5365.3873.0765.3865.3842.3072.7273.9180.8561.8171.3448.88BFS690.9089.4791.3090.9081.8194.4476.9265.3880.7676.9269.2365.3883.3375.5585.7183.3375.0077.27884.2188.2370.0056.6677.2755.0061.5357.6953.8465.3865.3842.3071.1169.7660.8660.7170.8347.82987.5084.2173.6850.0073.9173.9153.8461.5353.8453.8465.3865.3866.6671.1162.2251.8569.3869.38988.8884.2190.4058.6285.7157.8961.5361.5373.0765.3869.2342.3072.7271.1180.8561.8176.5948.88988.8884.2190.4058.6285.7157.8961.5361.5373.0765.3869.2342.3072.7271.1180.8561.8176.5948.88EFS385.7185.7185.7185.7185.7193.3369.2369.2369.2369.2369.2353.8476.5976.5976.5976.5976.5968.29475.0089.4781.8180.9590.0086.6669.2365.3869.2365.3869.2350.0071.9975.5575.0072.3478.2663.41680.9584.2173.9159.2578.2655.5565.3861.5365.3861.5369.2338.4672.3471.1169.3860.3773.4645.45785.7184.2176.0059.2585.7152.9469.2361.5373.0761.5369.2334.6176.5971.1174.5060.3776.5941.861085.0084.2178.2658.6275.0057.8965.3861.5369.2365.3869.2342.3080.3271.1173.4661.8171.9948.88RFE581.8175.0090.0090.0079.1665.2169.2357.6969.2369.2373.0757.6975.0065.2178.2678.2676.0061.22678.2689.4781.8181.8189.4794.4469.2365.3869.2369.2365.3865.3873.4675.5575.0075.0075.5577.27786.3689.4786.3694.7381.8189.4773.0765.3873.0769.2369.2365.3879.1675.5579.1679.9975.0075.55894.7389.4785.0085.7185.0085.0069.2365.3865.3869.2365.3865.3879.9075.5573.9176.5973.9173.91984.2189.4780.9590.0085.0085.0061.5365.3865.3869.2365.3865.3871.1175.5572.3478.2673.9173.91Lasso1184.2185.0082.6058.6281.8157.8961.5365.3873.0765.3869.2342.3071.1173.9177.5561.8175.0048.88Ridge583.3369.2382.6082.6065.5166.6676.9269.2373.0773.0773.0761.5380.0069.2377.5577.5569.0964.00IFS: initial feature set, ANOVA: ANOVA method, CHI: Chi-square, MI: mutual information, RELIEF: ReliefF method, FFS: forward feature selection, BFS: backward feature selection, EFS: exhaustive feature selection, RFE: recursive feature selection, Lasso: Lasso regression, Ridge: ridge regression.As shown in Table7, all the models created with combining feature selection techniques have achieved more than 80% accuracy. Furthermore, among all the feature selection categories, wrapper-based techniques, namely, FFS, BFS, EFS, and RFS, have obtained higher classification performances than the other two categories, above 83%.Table 7
Summary of performance.
Feature selection categoryTechniquesMaximum accuracy (%)Number of featuresClassification techniqueInitial dataset—63.9213KNNFilterANOVA83.608RFANOVA83.608LRChi-square81.969DTChi-square81.9610DTMutual information83.607LRRelief83.607LRWrapperFFS85.245RFFFS85.245DTBFS88.526DTEFS83.604LRRFE85.247KNNRFE85.248RFEmbeddedLasso81.9611DTRidge83.605RF


## 4.1. Feature Selection Result

Table5 shows the reduced feature subsets using different feature selection algorithms. Each feature in the table is denoted by values of 1 or 0. If the feature appears in the feature subset, it is denoted by 1; otherwise, it is denoted by 0 in accordance with the following attribute sequence.Table 5
Reduced feature subsets using filter, wrapper, and embedded methods.
Feature selection methodFeaturesSize of feature subsetF1F2F3F4F5F6F7F8F9F10F11F12F13ANOVA00100001110116001000011111170110000111111811100001111119111000111111110Chi-square00001001110116100010011101171001100111011810111001110119101110111101110Mutual information00100001110116001000011111170010100111111800101101111119011011011111110Relief00100000111116001000011111170110000111111811100001111119111000111111110Forward feature selection (FFS)1010000000011411100000000115111000010001161010100101011710111011010119Backward feature selection (BFS)0110001010011610111011010108110011110110191011101011011910111011010119Exhaustive feature selection (EFS)00000000100113001000001001140010100110011601101001010117111110111001110Recursive feature elimination (RFE)0110000010110501100000101116011000101011170110001011111801100110111119Lasso (L1)111110111101111Ridge (L2)01100010100105According to the statistics in Figure3, the most significant feature for predicting heart disease is F12, followed by F13, F3, F9, and F10; nevertheless, these features are ordered across feature selection methods.


## 4.2. Classification Result

The accuracies obtained by the analysis, on the Cleveland heart datasets, of the different feature subsets selected by filter, wrapper, and embedded methods are shown in Figures4–6.Figure 4
Classification accuracies of reduced feature subsets using filter-based methods with RF, SVM, DT, KNN, LR, and GNB (NOF: number of features, IFS: initial feature set, ANOVA: ANOVA method, CHI: Chi-square, MI: mutual information, RELIEF: Relief method).Figure 5
Classification accuracies of reduced feature subsets using wrapper-based methods with RF, SVM, DT, KNN, LR, and GNB (NOF: number of features, IFS: initial feature set, FFS: forward feature selection, BFS: backward feature selection, EFS: exhaustive feature selection, RFE: recursive feature selection).Figure 6
Classification accuracies of reduced feature subsets using wrapper-based methods with RF, SVM, DT, KNN, LR, and GNB (NOF: number of features, IFS: initial feature set, Lasso: Lasso regression, Ridge: ridge regression).Figure5 summarizes the heart disease prediction accuracies using the optimal feature set identified by ANOVA, Chi-square, mutual information, and Relief techniques on various learning algorithms.The classification accuracies of the feature set identified by FFS, BFS, EFS, and RFE techniques categorized under the wrapper-based methods are presented in Figure5. The accuracies of embedded feature selectors with learning algorithms are illustrated in Figure 6.According to the result obtained by the analysis, all models constructed from the selected feature subsets utilizing a variety of different feature selection approaches outperform the original dataset feature subsets. The original feature set has achieved maximum accuracy of 63.92%, precision of 58.33%, sensitivity of 53.84%, and f-measure of 55.99% with the KNN classifier. After applying all feature selection approaches, the accuracy of the classifiers significantly improved.Table6 summarizes the best accuracy performance of each feature selection technique. The feature subset selected by the backward feature selection technique has achieved the highest classification accuracy of 88.52%, precision of 91.30%, sensitivity of 80.76%, and f-measure of 85.71% with the DT classifier. The selected features are F2, F3, F7, F9, F12, and F13.Table 6
Performance measure of best-reduced feature subsets using the filter, wrapper, and embedded methods.
Feature selection techniquesNumber of featuresPrecisionSensitivityF-measureRFSVMDTKNNLRGNBRFSVMDTKNNLRGNBRFSVMDTKNNLRGNBIFS1342.8535.0050.0058.3335.7130.0034.6126.9238.4653.8438.4611.5338.2930.4343.4755.9937.0316.66ANOVA680.9589.4771.4288.2389.4768.7565.3865.3857.6957.6965.3842.3072.3475.5563.8269.7675.5552.38784.2189.4769.5687.5090.0068.7561.5365.3861.5353.8469.2342.3071.1175.5565.3066.6678.2652.38894.4489.4768.1893.3390.0070.5865.3865.3857.6953.8469.2346.1577.2775.5562.4968.2978.2655.81980.9589.4770.8368.7585.7170.5865.3865.3865.3842.3069.2346.1572.3475.5568.0052.3876.5955.811085.0089.4770.0070.5885.0070.5865.3865.3853.8446.1565.3846.1573.9175.5560.8655.8173.9155.81Chi671.4280.0064.7059.2580.9556.2557.6961.5342.3061.5365.3834.6163.8269.5651.1660.3772.3442.85771.4280.0061.5351.8577.2760.0057.6961.5361.5353.8465.3846.1563.8269.5661.5352.8370.8352.17877.2777.2768.1856.6672.7257.8965.3865.3857.6965.3861.5342.3070.8370.8362.4960.7166.6648.88984.2184.2182.6058.6276.1957.8961.5361.5373.0765.3861.5342.3071.1171.1177.5561.8168.0848.801084.2184.2182.6058.6277.2757.8961.5361.5373.0765.3865.3842.3071.1171.1177.5561.8170.8348.80MI685.0089.4771.4288.2389.4768.7565.3865.3857.6957.6965.3842.3073.9175.5563.8269.7675.5552.38788.8889.4769.5687.5090.0068.7561.5365.3861.5353.8469.2342.3072.7275.5565.3066.6678.2652.38880.0085.0066.6659.2585.7152.9461.5365.3853.8461.5369.2334.6169.5673.9159.5760.3776.5941.86985.0085.0064.0059.2585.7152.9465.3865.3861.5361.5369.2334.6173.9173.9162.7460.3776.5941.861080.9585.0069.2359.2581.8152.9465.3865.3869.2361.5369.2334.6172.3473.9169.2360.3775.0041.86Relief684.2189.4775.0072.7285.0083.3361.5365.3857.6961.5365.3857.6971.1175.5565.2166.6673.9168.18788.8889.4769.5687.5090.0068.7561.5365.3861.5353.8469.2342.3072.7275.5565.3066.6678.2652.38894.1189.4772.7293.3390.0070.5861.5365.3861.5353.8469.2346.1574.4175.5566.6668.2978.2655.81983.3389.4768.1868.7585.7170.5857.6965.3857.6942.3069.2346.1568.1875.5562.4952.3876.5955.811085.0089.4772.7270.5885.0070.5865.3865.3861.5346.1565.3846.1573.9175.5566.6655.8173.9155.81FFS483.6082.3585.0088.8882.3581.2873.0753.8465.3861.5353.8450.0079.1665.1173.9172.7265.1161.90586.9582.3584.0088.8884.2181.2576.9253.8480.7661.5361.5350.0081.6365.1182.3572.7271.1161.90686.3689.4778.5763.6390.0070.5873.0765.3884.6153.8469.2346.1579.1675.5581.4858.3378.2655.81780.0084.2168.1850.0085.7160.0061.5361.5357.6953.8469.2346.1569.5671.1164.4951.8576.5952.17988.8885.0090.4758.6280.9557.8961.5365.3873.0765.3865.3842.3072.7273.9180.8561.8171.3448.88BFS690.9089.4791.3090.9081.8194.4476.9265.3880.7676.9269.2365.3883.3375.5585.7183.3375.0077.27884.2188.2370.0056.6677.2755.0061.5357.6953.8465.3865.3842.3071.1169.7660.8660.7170.8347.82987.5084.2173.6850.0073.9173.9153.8461.5353.8453.8465.3865.3866.6671.1162.2251.8569.3869.38988.8884.2190.4058.6285.7157.8961.5361.5373.0765.3869.2342.3072.7271.1180.8561.8176.5948.88988.8884.2190.4058.6285.7157.8961.5361.5373.0765.3869.2342.3072.7271.1180.8561.8176.5948.88EFS385.7185.7185.7185.7185.7193.3369.2369.2369.2369.2369.2353.8476.5976.5976.5976.5976.5968.29475.0089.4781.8180.9590.0086.6669.2365.3869.2365.3869.2350.0071.9975.5575.0072.3478.2663.41680.9584.2173.9159.2578.2655.5565.3861.5365.3861.5369.2338.4672.3471.1169.3860.3773.4645.45785.7184.2176.0059.2585.7152.9469.2361.5373.0761.5369.2334.6176.5971.1174.5060.3776.5941.861085.0084.2178.2658.6275.0057.8965.3861.5369.2365.3869.2342.3080.3271.1173.4661.8171.9948.88RFE581.8175.0090.0090.0079.1665.2169.2357.6969.2369.2373.0757.6975.0065.2178.2678.2676.0061.22678.2689.4781.8181.8189.4794.4469.2365.3869.2369.2365.3865.3873.4675.5575.0075.0075.5577.27786.3689.4786.3694.7381.8189.4773.0765.3873.0769.2369.2365.3879.1675.5579.1679.9975.0075.55894.7389.4785.0085.7185.0085.0069.2365.3865.3869.2365.3865.3879.9075.5573.9176.5973.9173.91984.2189.4780.9590.0085.0085.0061.5365.3865.3869.2365.3865.3871.1175.5572.3478.2673.9173.91Lasso1184.2185.0082.6058.6281.8157.8961.5365.3873.0765.3869.2342.3071.1173.9177.5561.8175.0048.88Ridge583.3369.2382.6082.6065.5166.6676.9269.2373.0773.0773.0761.5380.0069.2377.5577.5569.0964.00IFS: initial feature set, ANOVA: ANOVA method, CHI: Chi-square, MI: mutual information, RELIEF: ReliefF method, FFS: forward feature selection, BFS: backward feature selection, EFS: exhaustive feature selection, RFE: recursive feature selection, Lasso: Lasso regression, Ridge: ridge regression.As shown in Table7, all the models created with combining feature selection techniques have achieved more than 80% accuracy. Furthermore, among all the feature selection categories, wrapper-based techniques, namely, FFS, BFS, EFS, and RFS, have obtained higher classification performances than the other two categories, above 83%.Table 7
Summary of performance.
Feature selection categoryTechniquesMaximum accuracy (%)Number of featuresClassification techniqueInitial dataset—63.9213KNNFilterANOVA83.608RFANOVA83.608LRChi-square81.969DTChi-square81.9610DTMutual information83.607LRRelief83.607LRWrapperFFS85.245RFFFS85.245DTBFS88.526DTEFS83.604LRRFE85.247KNNRFE85.248RFEmbeddedLasso81.9611DTRidge83.605RF


## 5. Conclusion and Future Work

The primary objective of this article is to examine the effect of feature selection approaches on the accuracy of heart disease prediction. This analysis was conducted against a collection of distinctive features extracted from frequently used Cleveland heart disease datasets available at the University of California, Irvine using various feature selection algorithms.Experiments were performed with and without feature selection to determine the effect of feature selection. ANOVA, Chi-square, mutual information, Relief, forward feature selection, backward feature selection, exhaustive feature selection, recursive feature elimination, Lasso regression, and Ridge regression were employed as feature selection algorithms. The analysis was conducted on six classification algorithms: decision tree, random forest, support vector machine, K-nearest neighbor, logistic regression, and Gaussian naive Bayes.Without feature selection, the highest result provides 63.92% model accuracy using the KNN classifier. The experiment was then conducted using feature selection. The prediction accuracy has improved the models that are developed with all the feature selection algorithms. Without feature selection, the maximum accuracy value was 63.92%; this value was increased to 88.52% using backward feature selection and a decision tree classifier. The experimental findings suggest that using feature selection algorithms is capable of classifying the disease well with a small number of features.The enhancements overutilizing the original dataset vary significantly depending on the feature selection approach and learning algorithm employed; hence, it is important to evaluate various feature selection strategies and learning algorithms combinations to obtain the best feasible model. However, without many experiments and analyses, it is impossible to predict which will be beneficial.In the future, multiple feature selection techniques can be used as assembling (hybrid) techniques to extract optimal feature subsets to develop models. Also, real-time medical datasets gathered from different countries can be used to model development. This could enhance the performance with improved accuracy for heart disease prediction.



---

*Source: 5581806-2021-11-01.xml*