# Application of Machine Learning for Cardiovascular Disease Risk Prediction

Authors: Surjeet Dalal; Pallavi Goel; Edeh Michael Onyema; Adnan Alharbi; Amena Mahmoud; Majed A. Algarni; Halifa Awal
Journal: Computational Intelligence and Neuroscience
 (2023)

---

## Abstract

Cardiovascular diseases (CVDs) are a common cause of heart failure globally. The need to explore possible ways to tackle the disease necessitated this study. The study designed a machine learning model for cardiovascular disease risk prediction in accordance with a dataset that contains 11 features which may be used to forecast the disease. The dataset from Kaggle on cardiovascular disease includes approximately 70,000 patient records that were used to determine the outcome. Compared to the UCI dataset, the Kaggle dataset has many more training and validation records. Models created using neural networks, random forests, Bayesian networks, C5.0, and QUEST were compared for this dataset. On training and testing data sets, the results acquired a high accuracy (99.1 percent), which is significantly superior to previous methods. Ahead-of-time detection and diagnosis of cardiac disease, as well as better treatment outcomes, are strong possibilities for the suggested prediction model. Additionally, it may help patients better manage their illness or life forms in order to increase their chances of recovery/survival. The result showed greater accuracy and promising signs that machine-learning algorithms can indeed assist in early identification of the disease and improvement of the treatment outcome.


---

## Body

## 1. Introduction

Cardiovascular disorders are frequently mistaken for diseases of the heart. Stroke, angina, and a heart attack are all symptoms of restricted or clogged blood arteries, which is what causes these diseases. Heart illness comes in a variety of forms, including those that affect the muscles, valves, or rhythm of the heart. If doctors could foresee these things carefully, treating and diagnosing patients would be much easier. Heart illness is the main sign of coronary artery disease, which is a false diagnosis. That is not the same as cardiovascular disease, an illness that impacts the blood vessels, since it is heart disease.At 25.4% of all U.S. fatalities in 2010, in addition to Canada and England, it was the main cause of death. Throughout the world, there is a similar issue. Heart disease is a time-sensitive condition, and early detection is critical[1]. Because of incorrect diagnosis or trial-and-error procedures, many patients’ health is compromised. Until there is an abundance of medical professionals and/or diagnostic errors are eliminated, the problem will persist [2]. Some patients may receive needless therapy or be brought to the hospital for chest discomfort. Specialists for diagnosis are few in many undeveloped nations. An automated system like this, then, might be beneficial to the medical community in assisting doctors with early correct diagnoses.There has to be an accurate representation of the disease’s many forms to accurately diagnose it. Examples must be carefully chosen if the system is to function safely and effectively. Machine learning (ML) is the branch of artificial intelligence (AI) that is being used in cardiovascular care. A computer’s ability to interpret data and classify a given task is essentially what this is all about. Mathematical optimization and statistical analysis are used in conjunction to forecast results in the ML framework, which is built on models that take in input data (such as images or text) (e.g., favorable, unfavorable, or neutral).Different ML algorithms are being used for classification and prediction targets. Examples of ML prediction and classification algorithms are SVM and boosting algorithms [3]. Decisions can be made using the random forest (RF) method, which averages many nodes. It is possible to classify and segment images using a convolutional neural network (CNN), which has several layers and nodes [4]. Each of these algorithms has been previously detailed in technical detail [5], but no agreement has developed to guide the selection of specific algorithms for clinical use in cardiovascular medicine.If favored performance in one or more particular problem groups is more important than overall performance, the design may be impacted by this. This is common in most medical tasks since the system’s performance may be needed to have a varying level of relevance for every class. As such, in the diagnosis of heart disease, the precision required for healthy individuals is extremely important, as a mistake in this area might lead to an unnecessary course of therapy for a healthy patient. Medical problems and data collected influence how well the system balances the performance of different groups. In addition, a shortage of medical specialists has led to an upsurge in the death rate of patients with a variety of diseases in the majority of nations. In most nations, heart disease has surpassed all other causes of death as the foremost reason for death in both urban and rural settings.The remainder of the essay is structured as follows: A brief review of some earlier studies on machine learning approaches in medical diagnosis is provided in Section2. The materials and procedures utilized in this investigation are described in Section 3 of the text. In Section 4, the experimental findings and analysis are presented. The article is concluded in Section 5.


## 2. Related Work

For the prediction of fatal complications during hospitalization, the authors [6] developed a multitask deep and wide neural network (MT-DWNN). During the previous 18 years, the algorithm was evaluated on 35,101 hospitalizations with an HF diagnosis and 2,478 hospitalizations with a renal failure diagnosis from the Chinese PLA General Hospital. For the renal failure problem, the AUC of the suggested technique (0.9393) is much better than that of traditional methods, whereas the AUC of single task deep neural networks (0.9370), random forest (0.9360), and logistic regression are all less than 0.9233. Predicting renal dysfunction in heart failure patients is easier using the MT-DWNN model, according to the findings of the experiments.Using well-organized training datasets, the authors in [7] proposed two deep neural networks for the effective expectation of coronary heart disease risk. Prediction procedures are unable to learn from irregular data in most real-world datasets. Rather than relying on entire or randomly chosen training datasets, they advocated constructing training datasets by distinguishing regular from a highly biased subset. Two processes are involved in the preparation of the training data: To improve the highly biased set, variable autoencoders separate the original training datasets into two sets: widely dispersed and highly skewed. The last step is to train two separate deep neural network classifiers. According to the suggested approach, the AUC was 0.882 and accuracy was 0.892, which outperformed more common methods in terms of specificity, accuracy, exactness, recall, and the f-measure (0.915).Machine-learning methods were proposed by the authors in [8] as a new way to predict obesity risk. Obesity and its underlying causes are the focus of this research. It is estimated that more than 1100 people of all ages and socioeconomic backgrounds participated in the survey. The proposed study covered nine machine-learning techniques. K-NN, multilayer perceptrons (MLP), random forest, Naive Bayes, support vector machines (SVM), adaptive boosting (ADA), logistic regression, decision trees, and gradient-boost classifiers were all evaluated for their efficacy. High-, medium-, and low-obesity individuals were categorized into three groups. Classifiers using the logistic regression algorithm achieve a correctness rate of 97 percent, which is higher than any other approach. Accuracy was 64.08 percent, and metrics were the lowest.The authors of reference [9] trained models for mortality and HF hospitalization risk assessment using three years of follow-up data. Brier scores and receiving-operating characteristic curves (ROCCs) were used to assess the model’s discriminating and calibrating abilities. To determine the best predictors, the best models were used in a 5-fold cross-validation procedure. The RF model’s mean C-statistic ranged from 0.72 to 0.75 when used to predict death (Brier score: 1.17) and hospitalization (95% CI: 0.72 to 0.75) with high accuracy (Brier rating: 0.76). BMI, urea nitrogen concentrations, and KCCQ subscale scores were all powerfully connected to mortality, while hemoglobin concentrations, time since the previous HF hospitalization, and KCCQ subscale scores were all strongly linked to HF hospitalization.It was predicted by the authors of reference [10] whether a person will be in a stroke or the control group. The mean area under the curve (AUC) of 76 was the average AUC for our models, which predicted whether each participant would be given either a small or a large shopping list (3 or 7 items). The AUC was 64, whether stroke patients or controls were included in the study. The biggest dissociating element in all categorization tests was the frequency with which aisles were returned. Eye movement data collected from virtual reality imitations may thus be utilized to diagnose cognitive deficiencies, which might lead to therapeutic uses in the future.According to the authors of reference [11], 265 of the 24,461 patients who were admitted to the Johns Hopkins Health System with acute decompensated heart failure developed CS. Logistic regression was the basis of their cohort identification method, which relies on patient vitals, laboratory results, and medication doses recorded during therapy. Their technique identified patients with a significant propensity for developing CS. The prevalence of CS was 10.2 times greater in the high-risk group compared to the low-risk group (95% CI, 6.1–17.2). Patients in the high-risk group were labeled high risk for a median of 1.7 days before their clinical team verified the CS diagnosis (interquartile range, 0.8–4.6). Furthermore, they looked at 50 patients at high risk who went on to develop CS and 50 who did not. From the time a model was identified as high risk until it was diagnosed with CS, 12 percent of patients received potentially incorrect treatment, whereas 50 percent received better-matched treatment alternatives. It was shown that 44% of the false-positive patients were diagnosed with CS or end-stage cardiomyopathy by their clinical teams.It was shown that the use of interpretable machine learning in the study of juvenile idiopathic, hereditary, or familial dilated cardiomyopathy helped researchers better understand the LV remodeling and mechanics of the LV, as well as the heart’s systolic and diastolic function (DCM). Data from juvenile DCM and healthy controls, including echocardiograms and clinical notes, were reviewed retrospectively in this study. Aortic, pulmonary vein, mitral, age, Doppler velocity traces, and body surface area were all input into the machine learning process, as were regional longitudinal strains during the cardiac cycle. Multiple kernel learning was utilized to minimize data dimensionality, placing patients in accordance with conglomerate information similarity. K-means then selects groups based on their similarities. Calculations were made to determine the percentage of people with DoT. When looking at the DoT proportions of each of the five phenotypic groups, it became clear that they were clinically unique. Only one DCM patient, who was not a healthy control, was assigned to groups 3–5, thereby proving that this method is accurate and reliable. Those in Cluster 5 were the oldest, the most medicated, and the most likely to have DoT, with mixed systolic and diastolic heart failure. Those in Cluster-4 were the oldest, with the most LV remodeling, but also the second-highest frequency of DoT, with moderate diastolic dysfunction and mild diastolic dysfunction. While there was a large amount of DoT in the third cluster of patients, there was only moderate remodeling and functional improvement in the second cluster of patients.Human heart rate variability (HRV) may be used to identify hypertensive persons who are at high risk of having a vascular event, according to the authors of reference [12]. It was used to develop an HRV model utilizing demographic information and HRV characteristics as well as a mix of both. The trained model’s highest accuracy was 97.08% during the afternoon, utilizing the combined set of characteristics. Furthermore, the F1 score and accuracy were 81.25% and 86.67% for identifying high-risk people, respectively. The model’s total area under the curve was 0.98, which indicates great sensitivity and specificity. Machine learning algorithms and heart rate variability may be used to predict vascular events in hypertensive patients, according to this research. With its simple but successful prediction technique and continued use, it aided doctors in their decision-making more than any other method now available.Heart rate increases, but heart rate variability and low- and high-frequency power decrease when exposed to thrilling music, according to the authors of reference [13]. It was being studied how harmonic intervals and noise stimuli affect the heart’s reaction to stimuli. Harmonic intervals and noise both affect cardiac activity, although in different ways. For example, the Poincare plot’s axis-to-ellipse ratio increased when subjects were exposed to both harmonic intervals and noise. A broad variety of cardiac responses is elicited by the stimuli’s frequency content, which includes both noise and harmonic intervals. Consonance quality in the heart’s reaction to harmonic intervals should also be considered.Invasive coronary angiography’s diagnostic value was improved by reducing patient risk and expense through better outpatient selection, as proposed by the authors of reference [14]. Over the course of 12 years, researchers examined invasive angiography recommendation data from Ontario, Canada’s provincial cardiac registry. The research comprised outpatients who had coronary angiography throughout the research duration. Using the training data, 8 prediction designs were built in Python utilizing grid-search cross-validation (80% random sample, and n = 5 23,750). The discriminative power of each model was assessed using a 20% random sampling from the 5938 data set.The authors of reference [15] claimed that hearts are the most significant organs in human bodies. High blood pressure and diabetes may result from a variety of lifestyle changes. Heart failure, on the other hand, is a devastating condition. There is no treatment for heart failure, which is a dangerous disease. The heart of the patient is not pumping blood as effectively as it should, resulting in this disease. One of the most difficult tasks in medicine is to make an accurate prediction of heart failure. As the world’s population has grown, so have the numbers of people suffering from heart failure. Based on the proportion of several performance metrics, this research is looking at machine learning algorithms (for example accurateness, preciseness, and recall). ML is shown. The ideal method for every measurement is projected. Many supervised ML methods, for example, logistic regression, decision tree, k-nn, and random forest, are used to analyze certain variables in the dataset. To write Python code, Anaconda Jupyter notebooks are utilized.An attempt was made by the authors of reference [16] in community-based groups to find and describe homogeneous echocardiographic characteristics. Studying phenotypes defined by echocardiography and their connections to vascular function and circulating biomarkers was done on the STANISLAS cohort’s first generation.Multilayer perception neural networks (MLP), support vector machines (SVM), and ensemble approaches are among the machine learning technologies the authors of reference [17] used to classify cardiovascular diseases. To assess the likely variations in approach uncertainty, they used two public datasets with notably distinct properties. There were over 300 distinct physiological data points per patient in the cardiac arrhythmia dataset by the University of California, Irvine (UCI) machine learning repository, although the distribution of cases was much skewed. This is compared to a Kaggle dataset that reports on cardiovascular illness and comprises over 75,000 patient records. It is important to note that this Kaggle dataset only includes a few variables per patient record: serum cholesterol levels, diastolic and synchronous blood pressure, comparative glucose level, and whether or not angina symptoms are present. According to their research, they compared their existing binary search technique with a partition-based strategy in various network circumstances to evaluate the suggested scheme’s performance. They utilized MATLAB (MathWorks, Natick, MA, USA) for numerical analysis and ran five simulations to acquire averaged findings.Heart sounds may be used to indicate CHF, according to the authors of reference [18]. Using the suggested method, it is possible to distinguish between healthy people and those with chronic heart failure and to identify diverse stages of the disease. Innovative CHF patients may be identified, and home-based CHF monitoring may be developed to reduce hospitalizations as a result of this new approach to identifying patients.The authors of reference [19] employed three ML frameworks to examine electronic health record data from 27,619 prior patient visits. A ratio of 80 : 20 was used to train and evaluate the models. Patients undergo central line surgery, according to the International Statistical Classification of Diseases and Related Health Problems. There were a total of ten codes [20]. XGBoost was the best-performing MLA for CLABSI risk prediction 48 hours after central line insertion with an AUROC of 0.762. Our findings suggest that MLAs might be useful clinical decision support tools for assessing the risk of CLABSI and that further study into them is warranted in this regard [21].


## 3. Materials and Methods

### 3.1. Dataset

The heart failure prediction dataset was obtained from the UCI machine learning repository for use in our study [22]. This dataset was developed by integrating previously accessible but previously uncombined datasets.


### 3.2. Data Preprocessing

The data are transformed via the process of preprocessing, which enables a more accurate machine-learning model to be constructed [23]. The preprocessing acts to enhance the quality of the data by performing several tasks, including the rejection of outliers, the filling of missing values, and the selection of features.


#### 3.2.1. Missing Value Identification

These missing values might be found by using the Python utility. To fill up a missing value, we substituted the mean value for it.


#### 3.2.2. Outlier Identification and Removal

An outlier is a data point or collection of data points that deviates from the rest of the dataset’s data values. In that instance, it is a data point or points in a dataset that appear outside of the broader distribution of data values. We used the Python script to filter the dataset for outliers and extreme values based on interquartile ranges.


#### 3.2.3. Feature Selection

Feature selection or variable selection is the procedure of choosing a subset of essential features or variables from the complete characteristics of a level in a data collection for machine learning algorithms. When trying to pin down the most critical characteristics, statisticians often turn to Pearson’s correlation technique. Using this method, the correlation coefficient may be calculated and used to determine the quality of the output and input [24]. Within a range of one-to-one, the coefficient is stable. More than or less than 0.5 implies a statistically significant connection, while zero indicates no correlation.


### 3.3. Design and Implementation of the Classification Model

Comprehensive investigations on heart failure prediction are conducted in this study using several ML classification approaches such as QUEST, random forest, neural network, and Bayesian network. Section 3.4 illustrates the suggested model diagram.


#### 3.3.1. QUEST

Selecting variables for splitting is performed using ANOVAF and Chi Square tests in a contingency table. A binary split is achieved by condensing variables with many classes into two super-classes (quadratic discriminant analysis). The tree may be pruned using the CART method. It may be utilized for the classification and regression. Discriminant coordinates are initially assigned to predictor categories in QUEST to transform categorical (symbolic) data into continuous variables [25]. By using a quadratic discriminant analysis, we can locate the split point (QDA). QDA typically provides two cut-off points; the one which is closest to the sample average of the primary superclass is selected. Figure 1 highlights the predicator importance in QUEST.Figure 1
Predicator importance in QUEST.The QUEST tree method has the benefit of not being biased in the split-variable selection, unlike CART, which is biased toward picking split variables that enable more splits and have more missing values. The construction of the decision tree is described below:MaxHR ≤ 143.284 [Mode: 1] (387)ST_Slope in [“Down” “Flat”] [Mode: 1] ≥1 (272; 0.893)ST_Slope in [“Up”] [Mode: 0] (115)Oldpeak ≤ 1.136 [Mode: 0] ≥0 (97; 0.887)Oldpeak > 1.136 [Mode: 1] ≥1 (18; 0.667)MaxHR > 143.284 [Mode: 0] (262)ST_Slope in [“Down” “Flat”] [Mode: 1] (106)ChestPainType in [“ATA” “NAP”] [ Mode: 0 ] ≥0 (48; 0.583)ChestPainType in [“ASY” “TA”] [ Mode: 1] ≥1 (58; 0.862)ST_Slope in [“Up”] [Mode: 0] (156)ChestPainType in [“ATA” “NAP” “TA”] [Mode: 0] ≥0 (116; 0.948)ChestPainType in [“ASY”] [Mode: 0] (40)FastingBS ≤ 0 [Mode: 0] ≥0 (33; 0.667)FastingBS > 0 [Mode: 1] ≥1 (7; 1.0)


#### 3.3.2. Random Forest

It is a regulated AI approach in light of the decision tree algorithm called the random forest model. Numerous businesses, including banking and online businesses, utilize this calculation to foresee client conduct and results. A few choice trees make up an irregular woodland calculation [26]. Bagging or bootstrap conglomeration is utilized to prepare the “woodland” of the arbitrary backwoods calculation [26]. A meta-algorithm group known as “bagging” is utilized to work on the precision of the AI algorithm of different sorts.The algorithm (random forest) uses the decision trees’ predictions to decide the outcome. It makes predictions by taking the average of multiple trees’ output. As the number of trees increases, so does the precision of the output. The decision tree approach has its limitations, but the random forest method solves them. Data overfitting is minimized, and accuracy is improved. A forecasting system does not need a large number of parameter settings (like scikit-learn). Figure2 highlights the predicator importance in random forest.Figure 2
Predicator importance in random forest.Feature names for short used in the random forest algorithm are explained in Table1.Table 1
Feature names for short used in the random forest algorithm.
Original field nameField name on graphicST_slope_upF-1ChestPainType_ASYF-2CholesterolF-3MaxHRF-4OldpeakF-5AgeF-6ST_slope_flatF-7ExerciseAnginaF-8RestingBPF-9SexF-10ChestPainType_ATAF-11FastingBSF-12RestingECG_LVHF-13RestingECG_normalF-14ChestPainType_NAPF-15RestingECG_STF-16ChestPainType_TAF-17ST_slope_downF-18If too many trees are used, the algorithm becomes too sluggish and ineffective for real-time predictions. As a rule, these algorithms are rapid to train but take a long time to make predictions once they have been trained.


#### 3.3.3. Neural Network

The evaluation of training samples is how neural networks, a kind of machine learning, enable a computer to learn to execute a job. In most cases, the examples have already been prelabeled by the students themselves [20]. For instance, an article acknowledgment framework might be given many labeled pictures of automobiles, homes, espresso cups, etc., and it would look for visual examples in the pictures that frequently relate with specific marks. Figure 3 describes the neural network designed for prediction of heart disease.Figure 3
The neural network in the current problem.Adding a constant (the bias) to an input shifts its activation function in the desired direction. An analogy for bias in neural networks is that of a linear function, where a constant value acts as a transposing constant. The logic inside the neural network has been defined with the help of Table2.Table 2
The Description of the neural network.
PointTypeXYV4dScale09.1667Bias08.3333Oldpeak06.6667RestingBP05.8333Cholesterol04.1667Age02.5MaxHR00.8333FastingBS18.8889Bias17.7778Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax16.6667Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax15.5556Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax14.4444Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax13.3333Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax12.2222Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax11.1111Hidden layer activation: hyperbolic tangent Output layer activation: SoftMaxSet07.5ST_slopeSet05ChestPainTypeSet03.3333SexSet01.6667ExerciseAnginaSet25HeartDiseaseMany basic processing nodes are tightly linked in a neural network that is roughly modeled on the human brain. To a large extent, today’s neural network architectures are “feed-forward,” meaning that data only travel in one way through the network’s layers of nodes. When a node gets data from a lower tier, it may also broadcast data to a higher layer, which may have a large number of lower layer nodes linked [21]. Figure 4 highlights the predicator importance in the neural network [27] designed for the current problem.Figure 4
The neural network in the current problem.


#### 3.3.4. Bayesian Network

A Bayesian network or confidence network is a graph whose nodes represent variables that each have two or more values with certain probabilities and whose links model dependency relationships between pairs of variables [28]. Figure5 highlights the predicator importance in the Bayesian Network designed for the current problem.Figure 5
The Bayesian network in the current problem.The Bayes rule is relatively basic but highly significant for connecting conditional probabilities:(1)pxy=pyx∗pxpy.Using evidence and prior knowledge about the likelihood of various hypotheses, the Bayes rule is a useful technique for estimating the posterior probability of a hypothesis. A Bayesian network can be used both for classification (the input nodes are set to match a specific data item, and the classification probabilities are read off the output node(s)) and more generally to investigate the interrelationships between the variables within a system. Figure6 highlights the distribution in the Bayesian network designed for the current problem.Figure 6
Distribution in the Bayesian network for the current problem.A probability table capturing all possible combinations of all variables would be a special-case Bayesian network where all node pairs are joined by a link. Because such a table would grow exponentially concerning the number of variables, the practical aim is generally to minimize the number of links by only linking nodes where a genuine dependency relationship exists [29]. Figure7 highlights the conditional probabilities in the Bayesian network designed for the current problem.Figure 7
Conditional probabilities in the Bayesian network for the current problem.A standard Bayesian network is a directed graph, but the direction is based solely on how the nodes are to be used (input/output) as well as on which topology allows the most information to be modeled with the fewest number of links. A causal network is a subtype where link directions express causality.


#### 3.3.5.C5.0

C5.0 is the decision tree-generating supervised machine learning algorithm. Ross Quinlan created the initial algorithm. C4.5, which is based on ID3, has been upgraded. By diminishing the assessed entropy esteem, this strategy achieves the ideal of segmenting the information at that hub into cleaner classes. This suggests that when every hub separates the information as per the standard at that hub, every subset of information partitioned by the standard will incorporate a smaller assortment of classes and, at last, only one class. Because this method is easy to calculate, C50 runs rapidly. C50 is tough. It can handle both numerical and category data. Based on the ruleset, we created the C5.0 model for the present situation. The rules are as follows:Rules for 1—contains 12 rule(s)Rule 1 for 1 (89; 0.978)if Cholesterol ≤ 42.500 and FastingBS > 0.500 then 1Rule 2 for 1 (106; 0.954)if Cholesterol ≤ 93 and ST_Slope = Flat then 1Rule 3 for 1 (274; 0.942)if Sex =M and ChestPainType = ASY and ST_Slope = Flat then 1Rule 4 for 1 (128; 0.938)if FastingBS >0.500 and ST_Slope = Flat then 1Rule 5 for 1 (11; 0.923)if Sex =M and ChestPainType = ATA and Cholesterol >245.500 and ST_Slope = Flat then 1Rule 6 for 1 (89; 0.923)if Sex =M and RestingECG = ST and ST_Slope = Flat then 1Rule 7 for 1 (264; 0.921)if Sex =M and ChestPainType = ASY and ExerciseAngina = Y then 1Rule 8 for 1 (272; 0.901)if ExerciseAngina =Y and ST_Slope = Flat then 1Rule 9 for 1 (338; 0.897)if Age >44 and Sex =M and ST_Slope = Flat then 1Rule 10 for 1 (7; 0.889)if Sex =F and RestingBP >148 and ExerciseAngina = N and ST_Slope = Flat then 1Rule 11 for 1 (6; 0.875)if RestingBP ≤ 117 and ExerciseAngina =N and ST_Slope = Down then 1Rule 12 for 1 (63; 0.769)if ST_Slope = Down then 1Rules for 0—contains 8 rule(s)Rule 1 for 0 (91; 0.978)if Cholesterol >42.500 and MaxHR ≤ 145 and Oldpeak ≤ 0.050 and ST_Slope = Upthen 0Rule 2 for 0 (42; 0.955)if Age ≤ 44 and ChestPainType = NAP then 0Rule 3 for 0 (80; 0.951)if ChestPainType = ATA and Cholesterol ≤ 245.500 and MaxHR >130 then 0Rule 4 for 0 (109; 0.937)if Sex =F and RestingBP ≤ 148 and FastingBS ≤ 0.500 and ExerciseAngina = Nthen 0Rule 5 for 0 (76; 0.923)if Cholesterol >42.500 and MaxHR >165 and Oldpeak ≤ 0.050 and ST_Slope = Upthen 0Rule 6 for 0 (9; 0.909)if ChestPainType = TA and Cholesterol >93 and Cholesterol ≤ 258 and RestingECG = LVHthen 0Rule 7 for 0 (8; 0.9)if Age ≤ 60 and RestingBP >117 and ExerciseAngina =N and ST_Slope = Downthen 0Rule 8 for 0 (395; 0.801)if ST_Slope = Up then 0Default: 1It can also tolerate missing data values. TheR implementation’s output may be either a decision tree or a rule set. The output model may be used to (predictively) assign a class to fresh, unclassified data items.


#### 3.3.6. Proposed Ensemble Method for Heart Failure Prediction

Numerous ML models have been developed in that research to deliver the best feasible predictions for the heart failure issue. A single model, on the other hand, might not produce the greatest predictions and might be vulnerable to flaws, for example, variance and bias. Multiple models were integrated into a single model to decrease mistakes and enhance predictions. This is referred to as ensemble learning. This suggested model may be used to enhance machine learning.(1) Steps of the Proposed Ensemble Method. Classifiers may be trained independently of one another and can provide predictions independently of one another. Voting for a majority among the individual results may be used to decide the final classes. Hybrid ensemble learning is the name given to this method. Figure 8 highlights the flowchart of the suggested collective model for the current problem.Figure 8
The flowchart of the proposed ensemble model for the current problem.Ensemble learning stacking is used to build the model. In addition, a meta-classifier or meta-model is used in this technique to incorporate many classifications or regression methods. To train lower-level models, the whole training dataset is used, and the composite model is trained using these findings. In contrast to boosting, the lower-level models are all trained at the same time. It is common practice to utilize the previous model’s prediction as a training dataset for the subsequent model, creating an algorithmic stack. Higher-level models serve as the foundation for the top-layer model, which is known for its great accuracy in making predictions. The stack builds until the most accurate forecast is made with the least amount of error. Many weak models or lower-layer projections form the basis of the combined model’s or meta-forecast model’s predictions. A less biased model is the end goal.


## 3.1. Dataset

The heart failure prediction dataset was obtained from the UCI machine learning repository for use in our study [22]. This dataset was developed by integrating previously accessible but previously uncombined datasets.


## 3.2. Data Preprocessing

The data are transformed via the process of preprocessing, which enables a more accurate machine-learning model to be constructed [23]. The preprocessing acts to enhance the quality of the data by performing several tasks, including the rejection of outliers, the filling of missing values, and the selection of features.


### 3.2.1. Missing Value Identification

These missing values might be found by using the Python utility. To fill up a missing value, we substituted the mean value for it.


### 3.2.2. Outlier Identification and Removal

An outlier is a data point or collection of data points that deviates from the rest of the dataset’s data values. In that instance, it is a data point or points in a dataset that appear outside of the broader distribution of data values. We used the Python script to filter the dataset for outliers and extreme values based on interquartile ranges.


### 3.2.3. Feature Selection

Feature selection or variable selection is the procedure of choosing a subset of essential features or variables from the complete characteristics of a level in a data collection for machine learning algorithms. When trying to pin down the most critical characteristics, statisticians often turn to Pearson’s correlation technique. Using this method, the correlation coefficient may be calculated and used to determine the quality of the output and input [24]. Within a range of one-to-one, the coefficient is stable. More than or less than 0.5 implies a statistically significant connection, while zero indicates no correlation.


## 3.2.1. Missing Value Identification

These missing values might be found by using the Python utility. To fill up a missing value, we substituted the mean value for it.


## 3.2.2. Outlier Identification and Removal

An outlier is a data point or collection of data points that deviates from the rest of the dataset’s data values. In that instance, it is a data point or points in a dataset that appear outside of the broader distribution of data values. We used the Python script to filter the dataset for outliers and extreme values based on interquartile ranges.


## 3.2.3. Feature Selection

Feature selection or variable selection is the procedure of choosing a subset of essential features or variables from the complete characteristics of a level in a data collection for machine learning algorithms. When trying to pin down the most critical characteristics, statisticians often turn to Pearson’s correlation technique. Using this method, the correlation coefficient may be calculated and used to determine the quality of the output and input [24]. Within a range of one-to-one, the coefficient is stable. More than or less than 0.5 implies a statistically significant connection, while zero indicates no correlation.


## 3.3. Design and Implementation of the Classification Model

Comprehensive investigations on heart failure prediction are conducted in this study using several ML classification approaches such as QUEST, random forest, neural network, and Bayesian network. Section 3.4 illustrates the suggested model diagram.


### 3.3.1. QUEST

Selecting variables for splitting is performed using ANOVAF and Chi Square tests in a contingency table. A binary split is achieved by condensing variables with many classes into two super-classes (quadratic discriminant analysis). The tree may be pruned using the CART method. It may be utilized for the classification and regression. Discriminant coordinates are initially assigned to predictor categories in QUEST to transform categorical (symbolic) data into continuous variables [25]. By using a quadratic discriminant analysis, we can locate the split point (QDA). QDA typically provides two cut-off points; the one which is closest to the sample average of the primary superclass is selected. Figure 1 highlights the predicator importance in QUEST.Figure 1
Predicator importance in QUEST.The QUEST tree method has the benefit of not being biased in the split-variable selection, unlike CART, which is biased toward picking split variables that enable more splits and have more missing values. The construction of the decision tree is described below:MaxHR ≤ 143.284 [Mode: 1] (387)ST_Slope in [“Down” “Flat”] [Mode: 1] ≥1 (272; 0.893)ST_Slope in [“Up”] [Mode: 0] (115)Oldpeak ≤ 1.136 [Mode: 0] ≥0 (97; 0.887)Oldpeak > 1.136 [Mode: 1] ≥1 (18; 0.667)MaxHR > 143.284 [Mode: 0] (262)ST_Slope in [“Down” “Flat”] [Mode: 1] (106)ChestPainType in [“ATA” “NAP”] [ Mode: 0 ] ≥0 (48; 0.583)ChestPainType in [“ASY” “TA”] [ Mode: 1] ≥1 (58; 0.862)ST_Slope in [“Up”] [Mode: 0] (156)ChestPainType in [“ATA” “NAP” “TA”] [Mode: 0] ≥0 (116; 0.948)ChestPainType in [“ASY”] [Mode: 0] (40)FastingBS ≤ 0 [Mode: 0] ≥0 (33; 0.667)FastingBS > 0 [Mode: 1] ≥1 (7; 1.0)


### 3.3.2. Random Forest

It is a regulated AI approach in light of the decision tree algorithm called the random forest model. Numerous businesses, including banking and online businesses, utilize this calculation to foresee client conduct and results. A few choice trees make up an irregular woodland calculation [26]. Bagging or bootstrap conglomeration is utilized to prepare the “woodland” of the arbitrary backwoods calculation [26]. A meta-algorithm group known as “bagging” is utilized to work on the precision of the AI algorithm of different sorts.The algorithm (random forest) uses the decision trees’ predictions to decide the outcome. It makes predictions by taking the average of multiple trees’ output. As the number of trees increases, so does the precision of the output. The decision tree approach has its limitations, but the random forest method solves them. Data overfitting is minimized, and accuracy is improved. A forecasting system does not need a large number of parameter settings (like scikit-learn). Figure2 highlights the predicator importance in random forest.Figure 2
Predicator importance in random forest.Feature names for short used in the random forest algorithm are explained in Table1.Table 1
Feature names for short used in the random forest algorithm.
Original field nameField name on graphicST_slope_upF-1ChestPainType_ASYF-2CholesterolF-3MaxHRF-4OldpeakF-5AgeF-6ST_slope_flatF-7ExerciseAnginaF-8RestingBPF-9SexF-10ChestPainType_ATAF-11FastingBSF-12RestingECG_LVHF-13RestingECG_normalF-14ChestPainType_NAPF-15RestingECG_STF-16ChestPainType_TAF-17ST_slope_downF-18If too many trees are used, the algorithm becomes too sluggish and ineffective for real-time predictions. As a rule, these algorithms are rapid to train but take a long time to make predictions once they have been trained.


### 3.3.3. Neural Network

The evaluation of training samples is how neural networks, a kind of machine learning, enable a computer to learn to execute a job. In most cases, the examples have already been prelabeled by the students themselves [20]. For instance, an article acknowledgment framework might be given many labeled pictures of automobiles, homes, espresso cups, etc., and it would look for visual examples in the pictures that frequently relate with specific marks. Figure 3 describes the neural network designed for prediction of heart disease.Figure 3
The neural network in the current problem.Adding a constant (the bias) to an input shifts its activation function in the desired direction. An analogy for bias in neural networks is that of a linear function, where a constant value acts as a transposing constant. The logic inside the neural network has been defined with the help of Table2.Table 2
The Description of the neural network.
PointTypeXYV4dScale09.1667Bias08.3333Oldpeak06.6667RestingBP05.8333Cholesterol04.1667Age02.5MaxHR00.8333FastingBS18.8889Bias17.7778Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax16.6667Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax15.5556Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax14.4444Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax13.3333Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax12.2222Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax11.1111Hidden layer activation: hyperbolic tangent Output layer activation: SoftMaxSet07.5ST_slopeSet05ChestPainTypeSet03.3333SexSet01.6667ExerciseAnginaSet25HeartDiseaseMany basic processing nodes are tightly linked in a neural network that is roughly modeled on the human brain. To a large extent, today’s neural network architectures are “feed-forward,” meaning that data only travel in one way through the network’s layers of nodes. When a node gets data from a lower tier, it may also broadcast data to a higher layer, which may have a large number of lower layer nodes linked [21]. Figure 4 highlights the predicator importance in the neural network [27] designed for the current problem.Figure 4
The neural network in the current problem.


### 3.3.4. Bayesian Network

A Bayesian network or confidence network is a graph whose nodes represent variables that each have two or more values with certain probabilities and whose links model dependency relationships between pairs of variables [28]. Figure5 highlights the predicator importance in the Bayesian Network designed for the current problem.Figure 5
The Bayesian network in the current problem.The Bayes rule is relatively basic but highly significant for connecting conditional probabilities:(1)pxy=pyx∗pxpy.Using evidence and prior knowledge about the likelihood of various hypotheses, the Bayes rule is a useful technique for estimating the posterior probability of a hypothesis. A Bayesian network can be used both for classification (the input nodes are set to match a specific data item, and the classification probabilities are read off the output node(s)) and more generally to investigate the interrelationships between the variables within a system. Figure6 highlights the distribution in the Bayesian network designed for the current problem.Figure 6
Distribution in the Bayesian network for the current problem.A probability table capturing all possible combinations of all variables would be a special-case Bayesian network where all node pairs are joined by a link. Because such a table would grow exponentially concerning the number of variables, the practical aim is generally to minimize the number of links by only linking nodes where a genuine dependency relationship exists [29]. Figure7 highlights the conditional probabilities in the Bayesian network designed for the current problem.Figure 7
Conditional probabilities in the Bayesian network for the current problem.A standard Bayesian network is a directed graph, but the direction is based solely on how the nodes are to be used (input/output) as well as on which topology allows the most information to be modeled with the fewest number of links. A causal network is a subtype where link directions express causality.


### 3.3.5.C5.0

C5.0 is the decision tree-generating supervised machine learning algorithm. Ross Quinlan created the initial algorithm. C4.5, which is based on ID3, has been upgraded. By diminishing the assessed entropy esteem, this strategy achieves the ideal of segmenting the information at that hub into cleaner classes. This suggests that when every hub separates the information as per the standard at that hub, every subset of information partitioned by the standard will incorporate a smaller assortment of classes and, at last, only one class. Because this method is easy to calculate, C50 runs rapidly. C50 is tough. It can handle both numerical and category data. Based on the ruleset, we created the C5.0 model for the present situation. The rules are as follows:Rules for 1—contains 12 rule(s)Rule 1 for 1 (89; 0.978)if Cholesterol ≤ 42.500 and FastingBS > 0.500 then 1Rule 2 for 1 (106; 0.954)if Cholesterol ≤ 93 and ST_Slope = Flat then 1Rule 3 for 1 (274; 0.942)if Sex =M and ChestPainType = ASY and ST_Slope = Flat then 1Rule 4 for 1 (128; 0.938)if FastingBS >0.500 and ST_Slope = Flat then 1Rule 5 for 1 (11; 0.923)if Sex =M and ChestPainType = ATA and Cholesterol >245.500 and ST_Slope = Flat then 1Rule 6 for 1 (89; 0.923)if Sex =M and RestingECG = ST and ST_Slope = Flat then 1Rule 7 for 1 (264; 0.921)if Sex =M and ChestPainType = ASY and ExerciseAngina = Y then 1Rule 8 for 1 (272; 0.901)if ExerciseAngina =Y and ST_Slope = Flat then 1Rule 9 for 1 (338; 0.897)if Age >44 and Sex =M and ST_Slope = Flat then 1Rule 10 for 1 (7; 0.889)if Sex =F and RestingBP >148 and ExerciseAngina = N and ST_Slope = Flat then 1Rule 11 for 1 (6; 0.875)if RestingBP ≤ 117 and ExerciseAngina =N and ST_Slope = Down then 1Rule 12 for 1 (63; 0.769)if ST_Slope = Down then 1Rules for 0—contains 8 rule(s)Rule 1 for 0 (91; 0.978)if Cholesterol >42.500 and MaxHR ≤ 145 and Oldpeak ≤ 0.050 and ST_Slope = Upthen 0Rule 2 for 0 (42; 0.955)if Age ≤ 44 and ChestPainType = NAP then 0Rule 3 for 0 (80; 0.951)if ChestPainType = ATA and Cholesterol ≤ 245.500 and MaxHR >130 then 0Rule 4 for 0 (109; 0.937)if Sex =F and RestingBP ≤ 148 and FastingBS ≤ 0.500 and ExerciseAngina = Nthen 0Rule 5 for 0 (76; 0.923)if Cholesterol >42.500 and MaxHR >165 and Oldpeak ≤ 0.050 and ST_Slope = Upthen 0Rule 6 for 0 (9; 0.909)if ChestPainType = TA and Cholesterol >93 and Cholesterol ≤ 258 and RestingECG = LVHthen 0Rule 7 for 0 (8; 0.9)if Age ≤ 60 and RestingBP >117 and ExerciseAngina =N and ST_Slope = Downthen 0Rule 8 for 0 (395; 0.801)if ST_Slope = Up then 0Default: 1It can also tolerate missing data values. TheR implementation’s output may be either a decision tree or a rule set. The output model may be used to (predictively) assign a class to fresh, unclassified data items.


### 3.3.6. Proposed Ensemble Method for Heart Failure Prediction

Numerous ML models have been developed in that research to deliver the best feasible predictions for the heart failure issue. A single model, on the other hand, might not produce the greatest predictions and might be vulnerable to flaws, for example, variance and bias. Multiple models were integrated into a single model to decrease mistakes and enhance predictions. This is referred to as ensemble learning. This suggested model may be used to enhance machine learning.(1) Steps of the Proposed Ensemble Method. Classifiers may be trained independently of one another and can provide predictions independently of one another. Voting for a majority among the individual results may be used to decide the final classes. Hybrid ensemble learning is the name given to this method. Figure 8 highlights the flowchart of the suggested collective model for the current problem.Figure 8
The flowchart of the proposed ensemble model for the current problem.Ensemble learning stacking is used to build the model. In addition, a meta-classifier or meta-model is used in this technique to incorporate many classifications or regression methods. To train lower-level models, the whole training dataset is used, and the composite model is trained using these findings. In contrast to boosting, the lower-level models are all trained at the same time. It is common practice to utilize the previous model’s prediction as a training dataset for the subsequent model, creating an algorithmic stack. Higher-level models serve as the foundation for the top-layer model, which is known for its great accuracy in making predictions. The stack builds until the most accurate forecast is made with the least amount of error. Many weak models or lower-layer projections form the basis of the combined model’s or meta-forecast model’s predictions. A less biased model is the end goal.


## 3.3.1. QUEST

Selecting variables for splitting is performed using ANOVAF and Chi Square tests in a contingency table. A binary split is achieved by condensing variables with many classes into two super-classes (quadratic discriminant analysis). The tree may be pruned using the CART method. It may be utilized for the classification and regression. Discriminant coordinates are initially assigned to predictor categories in QUEST to transform categorical (symbolic) data into continuous variables [25]. By using a quadratic discriminant analysis, we can locate the split point (QDA). QDA typically provides two cut-off points; the one which is closest to the sample average of the primary superclass is selected. Figure 1 highlights the predicator importance in QUEST.Figure 1
Predicator importance in QUEST.The QUEST tree method has the benefit of not being biased in the split-variable selection, unlike CART, which is biased toward picking split variables that enable more splits and have more missing values. The construction of the decision tree is described below:MaxHR ≤ 143.284 [Mode: 1] (387)ST_Slope in [“Down” “Flat”] [Mode: 1] ≥1 (272; 0.893)ST_Slope in [“Up”] [Mode: 0] (115)Oldpeak ≤ 1.136 [Mode: 0] ≥0 (97; 0.887)Oldpeak > 1.136 [Mode: 1] ≥1 (18; 0.667)MaxHR > 143.284 [Mode: 0] (262)ST_Slope in [“Down” “Flat”] [Mode: 1] (106)ChestPainType in [“ATA” “NAP”] [ Mode: 0 ] ≥0 (48; 0.583)ChestPainType in [“ASY” “TA”] [ Mode: 1] ≥1 (58; 0.862)ST_Slope in [“Up”] [Mode: 0] (156)ChestPainType in [“ATA” “NAP” “TA”] [Mode: 0] ≥0 (116; 0.948)ChestPainType in [“ASY”] [Mode: 0] (40)FastingBS ≤ 0 [Mode: 0] ≥0 (33; 0.667)FastingBS > 0 [Mode: 1] ≥1 (7; 1.0)


## 3.3.2. Random Forest

It is a regulated AI approach in light of the decision tree algorithm called the random forest model. Numerous businesses, including banking and online businesses, utilize this calculation to foresee client conduct and results. A few choice trees make up an irregular woodland calculation [26]. Bagging or bootstrap conglomeration is utilized to prepare the “woodland” of the arbitrary backwoods calculation [26]. A meta-algorithm group known as “bagging” is utilized to work on the precision of the AI algorithm of different sorts.The algorithm (random forest) uses the decision trees’ predictions to decide the outcome. It makes predictions by taking the average of multiple trees’ output. As the number of trees increases, so does the precision of the output. The decision tree approach has its limitations, but the random forest method solves them. Data overfitting is minimized, and accuracy is improved. A forecasting system does not need a large number of parameter settings (like scikit-learn). Figure2 highlights the predicator importance in random forest.Figure 2
Predicator importance in random forest.Feature names for short used in the random forest algorithm are explained in Table1.Table 1
Feature names for short used in the random forest algorithm.
Original field nameField name on graphicST_slope_upF-1ChestPainType_ASYF-2CholesterolF-3MaxHRF-4OldpeakF-5AgeF-6ST_slope_flatF-7ExerciseAnginaF-8RestingBPF-9SexF-10ChestPainType_ATAF-11FastingBSF-12RestingECG_LVHF-13RestingECG_normalF-14ChestPainType_NAPF-15RestingECG_STF-16ChestPainType_TAF-17ST_slope_downF-18If too many trees are used, the algorithm becomes too sluggish and ineffective for real-time predictions. As a rule, these algorithms are rapid to train but take a long time to make predictions once they have been trained.


## 3.3.3. Neural Network

The evaluation of training samples is how neural networks, a kind of machine learning, enable a computer to learn to execute a job. In most cases, the examples have already been prelabeled by the students themselves [20]. For instance, an article acknowledgment framework might be given many labeled pictures of automobiles, homes, espresso cups, etc., and it would look for visual examples in the pictures that frequently relate with specific marks. Figure 3 describes the neural network designed for prediction of heart disease.Figure 3
The neural network in the current problem.Adding a constant (the bias) to an input shifts its activation function in the desired direction. An analogy for bias in neural networks is that of a linear function, where a constant value acts as a transposing constant. The logic inside the neural network has been defined with the help of Table2.Table 2
The Description of the neural network.
PointTypeXYV4dScale09.1667Bias08.3333Oldpeak06.6667RestingBP05.8333Cholesterol04.1667Age02.5MaxHR00.8333FastingBS18.8889Bias17.7778Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax16.6667Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax15.5556Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax14.4444Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax13.3333Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax12.2222Hidden layer activation: hyperbolic tangent Output layer activation: SoftMax11.1111Hidden layer activation: hyperbolic tangent Output layer activation: SoftMaxSet07.5ST_slopeSet05ChestPainTypeSet03.3333SexSet01.6667ExerciseAnginaSet25HeartDiseaseMany basic processing nodes are tightly linked in a neural network that is roughly modeled on the human brain. To a large extent, today’s neural network architectures are “feed-forward,” meaning that data only travel in one way through the network’s layers of nodes. When a node gets data from a lower tier, it may also broadcast data to a higher layer, which may have a large number of lower layer nodes linked [21]. Figure 4 highlights the predicator importance in the neural network [27] designed for the current problem.Figure 4
The neural network in the current problem.


## 3.3.4. Bayesian Network

A Bayesian network or confidence network is a graph whose nodes represent variables that each have two or more values with certain probabilities and whose links model dependency relationships between pairs of variables [28]. Figure5 highlights the predicator importance in the Bayesian Network designed for the current problem.Figure 5
The Bayesian network in the current problem.The Bayes rule is relatively basic but highly significant for connecting conditional probabilities:(1)pxy=pyx∗pxpy.Using evidence and prior knowledge about the likelihood of various hypotheses, the Bayes rule is a useful technique for estimating the posterior probability of a hypothesis. A Bayesian network can be used both for classification (the input nodes are set to match a specific data item, and the classification probabilities are read off the output node(s)) and more generally to investigate the interrelationships between the variables within a system. Figure6 highlights the distribution in the Bayesian network designed for the current problem.Figure 6
Distribution in the Bayesian network for the current problem.A probability table capturing all possible combinations of all variables would be a special-case Bayesian network where all node pairs are joined by a link. Because such a table would grow exponentially concerning the number of variables, the practical aim is generally to minimize the number of links by only linking nodes where a genuine dependency relationship exists [29]. Figure7 highlights the conditional probabilities in the Bayesian network designed for the current problem.Figure 7
Conditional probabilities in the Bayesian network for the current problem.A standard Bayesian network is a directed graph, but the direction is based solely on how the nodes are to be used (input/output) as well as on which topology allows the most information to be modeled with the fewest number of links. A causal network is a subtype where link directions express causality.


## 3.3.5.C5.0

C5.0 is the decision tree-generating supervised machine learning algorithm. Ross Quinlan created the initial algorithm. C4.5, which is based on ID3, has been upgraded. By diminishing the assessed entropy esteem, this strategy achieves the ideal of segmenting the information at that hub into cleaner classes. This suggests that when every hub separates the information as per the standard at that hub, every subset of information partitioned by the standard will incorporate a smaller assortment of classes and, at last, only one class. Because this method is easy to calculate, C50 runs rapidly. C50 is tough. It can handle both numerical and category data. Based on the ruleset, we created the C5.0 model for the present situation. The rules are as follows:Rules for 1—contains 12 rule(s)Rule 1 for 1 (89; 0.978)if Cholesterol ≤ 42.500 and FastingBS > 0.500 then 1Rule 2 for 1 (106; 0.954)if Cholesterol ≤ 93 and ST_Slope = Flat then 1Rule 3 for 1 (274; 0.942)if Sex =M and ChestPainType = ASY and ST_Slope = Flat then 1Rule 4 for 1 (128; 0.938)if FastingBS >0.500 and ST_Slope = Flat then 1Rule 5 for 1 (11; 0.923)if Sex =M and ChestPainType = ATA and Cholesterol >245.500 and ST_Slope = Flat then 1Rule 6 for 1 (89; 0.923)if Sex =M and RestingECG = ST and ST_Slope = Flat then 1Rule 7 for 1 (264; 0.921)if Sex =M and ChestPainType = ASY and ExerciseAngina = Y then 1Rule 8 for 1 (272; 0.901)if ExerciseAngina =Y and ST_Slope = Flat then 1Rule 9 for 1 (338; 0.897)if Age >44 and Sex =M and ST_Slope = Flat then 1Rule 10 for 1 (7; 0.889)if Sex =F and RestingBP >148 and ExerciseAngina = N and ST_Slope = Flat then 1Rule 11 for 1 (6; 0.875)if RestingBP ≤ 117 and ExerciseAngina =N and ST_Slope = Down then 1Rule 12 for 1 (63; 0.769)if ST_Slope = Down then 1Rules for 0—contains 8 rule(s)Rule 1 for 0 (91; 0.978)if Cholesterol >42.500 and MaxHR ≤ 145 and Oldpeak ≤ 0.050 and ST_Slope = Upthen 0Rule 2 for 0 (42; 0.955)if Age ≤ 44 and ChestPainType = NAP then 0Rule 3 for 0 (80; 0.951)if ChestPainType = ATA and Cholesterol ≤ 245.500 and MaxHR >130 then 0Rule 4 for 0 (109; 0.937)if Sex =F and RestingBP ≤ 148 and FastingBS ≤ 0.500 and ExerciseAngina = Nthen 0Rule 5 for 0 (76; 0.923)if Cholesterol >42.500 and MaxHR >165 and Oldpeak ≤ 0.050 and ST_Slope = Upthen 0Rule 6 for 0 (9; 0.909)if ChestPainType = TA and Cholesterol >93 and Cholesterol ≤ 258 and RestingECG = LVHthen 0Rule 7 for 0 (8; 0.9)if Age ≤ 60 and RestingBP >117 and ExerciseAngina =N and ST_Slope = Downthen 0Rule 8 for 0 (395; 0.801)if ST_Slope = Up then 0Default: 1It can also tolerate missing data values. TheR implementation’s output may be either a decision tree or a rule set. The output model may be used to (predictively) assign a class to fresh, unclassified data items.


## 3.3.6. Proposed Ensemble Method for Heart Failure Prediction

Numerous ML models have been developed in that research to deliver the best feasible predictions for the heart failure issue. A single model, on the other hand, might not produce the greatest predictions and might be vulnerable to flaws, for example, variance and bias. Multiple models were integrated into a single model to decrease mistakes and enhance predictions. This is referred to as ensemble learning. This suggested model may be used to enhance machine learning.(1) Steps of the Proposed Ensemble Method. Classifiers may be trained independently of one another and can provide predictions independently of one another. Voting for a majority among the individual results may be used to decide the final classes. Hybrid ensemble learning is the name given to this method. Figure 8 highlights the flowchart of the suggested collective model for the current problem.Figure 8
The flowchart of the proposed ensemble model for the current problem.Ensemble learning stacking is used to build the model. In addition, a meta-classifier or meta-model is used in this technique to incorporate many classifications or regression methods. To train lower-level models, the whole training dataset is used, and the composite model is trained using these findings. In contrast to boosting, the lower-level models are all trained at the same time. It is common practice to utilize the previous model’s prediction as a training dataset for the subsequent model, creating an algorithmic stack. Higher-level models serve as the foundation for the top-layer model, which is known for its great accuracy in making predictions. The stack builds until the most accurate forecast is made with the least amount of error. Many weak models or lower-layer projections form the basis of the combined model’s or meta-forecast model’s predictions. A less biased model is the end goal.


## 4. Results and Discussion

The study sample consisted of 79% males, with an average age of 54 years. The rest of the patients (21%) were female, with an average age of 52 years.


### 4.1. Machine Learning Approaches and Comparison of Predictive Performance

The results are presented according to the performance metrics applied in each algorithm. Figures9–13 show the metrics of each model studied after being tested individually ten times, as well as the standard deviation information.Figure 9
Metrics of the Bayes network for the current problem.Figure 10
Metrics of the neural network for the current problem.Figure 11
Metrics of QUEST for the current problem.Figure 12
Metrics of random forest for the current problem.Figure 13
Metrics ofC5.0 for the current problem.Class imbalance has a considerable effect on the ROC AUC, which is particularly sensitive to the presence of a “positive” class. This is a really admirable trait. For example, accuracy is not sensitive in this way.


### 4.2. Predictive Performance of the Proposed Ensemble Model

This section demonstrates the predictive performance of the proposed ensemble model. Figure14 demonstrates the quality comparison between existing models and the proposed ensemble model.Figure 14
Quality comparisons of the proposed model for the current problem.Figure15 demonstrates the accuracy comparison between existing models and the proposed ensemble model.Figure 15
Accuracy comparisons of the proposed model for the current problem.Figure16 demonstrates the accuracy comparison of component models.Figure 16
Accuracy comparisons of component models for the current problem.Patients with heart disease, both those at risk for developing it and those who have already developed it, require early identification and therapy using the suggested machine learning model. Figure17 highlights the accuracy comparison of machine learning models.Figure 17
Accuracy comparison of ML models.The study agrees with some other previous studies which emphasized the power of machine learning and other related technologies in health prediction and improved health outcomes.


## 4.1. Machine Learning Approaches and Comparison of Predictive Performance

The results are presented according to the performance metrics applied in each algorithm. Figures9–13 show the metrics of each model studied after being tested individually ten times, as well as the standard deviation information.Figure 9
Metrics of the Bayes network for the current problem.Figure 10
Metrics of the neural network for the current problem.Figure 11
Metrics of QUEST for the current problem.Figure 12
Metrics of random forest for the current problem.Figure 13
Metrics ofC5.0 for the current problem.Class imbalance has a considerable effect on the ROC AUC, which is particularly sensitive to the presence of a “positive” class. This is a really admirable trait. For example, accuracy is not sensitive in this way.


## 4.2. Predictive Performance of the Proposed Ensemble Model

This section demonstrates the predictive performance of the proposed ensemble model. Figure14 demonstrates the quality comparison between existing models and the proposed ensemble model.Figure 14
Quality comparisons of the proposed model for the current problem.Figure15 demonstrates the accuracy comparison between existing models and the proposed ensemble model.Figure 15
Accuracy comparisons of the proposed model for the current problem.Figure16 demonstrates the accuracy comparison of component models.Figure 16
Accuracy comparisons of component models for the current problem.Patients with heart disease, both those at risk for developing it and those who have already developed it, require early identification and therapy using the suggested machine learning model. Figure17 highlights the accuracy comparison of machine learning models.Figure 17
Accuracy comparison of ML models.The study agrees with some other previous studies which emphasized the power of machine learning and other related technologies in health prediction and improved health outcomes.


## 5. Conclusion

The latest algorithms use advanced machine learning approaches and openly available patient data to forecast the risk of heart failure in patients. According to the study’s other main conclusion, patients’ outcomes may be strongly affected by data on their health status and value of life that are not typically gathered during clinical interactions. A number of chest pain models can be utilized by doctors to make conclusions regarding a patient’s prognosis. Our methodology, we believe, has to be continuously improved and evolved. Other parameters such as echocardiography data or other imaging modalities, for example, may be included in the model in the future.



---

*Source: 9418666-2023-03-01.xml*