# Machine Learning-Based Heart Disease Prediction: A Comparative Evaluation of Classification Methods

Abdelwaheb Ifa

► To cite this version:

Abdelwaheb Ifa. Machine Learning-Based Heart Disease Prediction: A Comparative Evaluation of Classification Methods. 2026. hal-05499127

HAL Id: hal-05499127

https://hal.science/hal-05499127v1

Preprint submitted on 7 Feb 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Machine Learning-Based Heart Disease Prediction: A Comparative Evaluation of Classification Methods

Abdelwaheb Ifa

University of Tunis El Manar, Faculty of Sciences of Tunis, Research Laboratory of PDE (LR03ES04) & University of Kairouan, Higher Institute of Applied Sciences and Technology of Kairouan, Tunisia

email: abdelwaheb.ifa@fsm.rnu.tn

## Abstract

Cardiovascular diseases represent a major cause of mortality worldwide, highlighting the need for reliable tools to support early diagnosis. This study evaluates the performance of supervised machine learning models for heart disease prediction using routinely collected clinical data from a publicly available dataset. Six classification algorithms are investigated, ranging from linear models to ensemble-based and neural approaches.

A reproducible experimental framework is adopted, including data preprocessing, feature encoding, feature engineering, and normalization, followed by a stratified 80/20 train-test split. Model evaluation is conducted using clinically relevant metrics, with particular emphasis on recall in order to limit false negative predictions in a screening context.

The results indicate that all models achieve comparable performance, with accuracy values between 86.96% and 88.04%. Linear models such as logistic regression and support vector machines exhibit high sensitivity, while ensemble-based methods, particularly random forest, provide the most balanced performance, reaching an accuracy of 88.04% and a recall of 92.16%.

Overall, these findings demonstrate the potential of machine learning techniques to support heart disease prediction and underline the importance of evaluation strategies aligned with clinical objectives. Although the study relies on a single dataset, the proposed framework offers a basis for further validation on larger and more diverse clinical cohorts.

**Keywords:** heart disease prediction, machine learning, random forest, support vector machine, logistic regression, KNN, XGBoost, MLP, clinical decision support.

# 1 Introduction

## 1.1 Context

Cardiovascular diseases (CVDs) remain one of the leading causes of mortality worldwide and represent a major public health burden. According to the World Health Organization, an estimated 19.8 million people died from CVDs in 2022, accounting for approximately one-third of all global deaths [10]. More than four out of five of these deaths are due to heart attacks and strokes, and a substantial proportion occur prematurely in individuals under 70 years of age [10]. Their clinical diagnosis and risk stratification rely on the combined assessment of multiple demographic, biological, and physiological factors, including age, blood pressure, cholesterol levels, and cardiac response to physical exertion.

The interactions between these variables are often complex and non-linear, which makes accurate cardiovascular risk assessment particularly challenging, especially in the context of early screening and
prevention. In routine clinical practice, diagnostic decisions frequently depend on predefined thresholds or on the qualitative interpretation of heterogeneous clinical indicators. While such approaches are well established, they may fail to capture subtle patterns across variables and can lead to diagnostic inaccuracies. In screening-oriented settings, false negative predictions are of particular concern, as undetected cardiovascular conditions may result in delayed intervention and adverse clinical outcomes.

In this context, data-driven approaches based on machine learning have gained increasing attention as complementary tools for clinical decision support. By learning predictive patterns directly from historical clinical data, machine learning models are able to capture complex relationships between risk factors that are difficult to formalize using rule-based or threshold-driven methods [6]. These techniques offer the potential to improve the consistency, reproducibility, and sensitivity of cardiovascular risk assessment. Consequently, machine learning-based predictive models hold significant promise for supporting early detection strategies and assisting healthcare professionals in identifying patients at elevated cardiovascular risk. When appropriately designed and evaluated with clinically relevant metrics, such models may contribute to more reliable screening processes and to the optimization of preventive cardiovascular care.

## 1.2 Role of Data

The performance and reliability of machine learning models in medical applications critically depend on the quality, structure, and representativeness of the data used for training. Clinical datasets are inherently heterogeneous, combining numerical, binary, and categorical variables, and may be affected by noise, outliers, or mild class imbalance. Consequently, a rigorous analysis and appropriate preprocessing of the data are essential to obtain stable and clinically meaningful predictive models.

In cardiovascular disease prediction, routinely collected clinical and physiological variables provide a valuable but simplified representation of patient health status. Publicly available datasets, such as those derived from Kaggle or UCI repositories, offer an accessible benchmark for methodological evaluation; however, they may also introduce limitations related to data collection procedures, population selection, and reduced clinical complexity. These factors can lead to potential biases and restrict the direct generalization of the results to real-world clinical settings.

Data quality further influences both model generalization and interpretability, two key requirements in medical decision-support systems. Well-prepared data contribute to robust learning behavior and help mitigate the risk of biased predictions. In this study, data analysis and preprocessing are therefore viewed as essential methodological steps, while the resulting findings are interpreted as exploratory and intended to support methodological comparison rather than immediate clinical validation.

## 1.3 Objective of the Study

The primary objective of this study is to investigate the effectiveness of supervised machine learning models for heart disease prediction using routinely collected clinical data, within a screening-oriented setting where minimizing false negative predictions is a critical requirement.

To achieve this goal, the study is structured around three specific objectives. First, a comparative evaluation of multiple classification models is conducted under a unified and clinically oriented evaluation protocol, with particular emphasis on recall and sensitivity rather than accuracy alone. This protocol is designed to reflect the practical constraints of cardiovascular screening, where undetected cases may have severe clinical consequences.

Second, an explicit analysis of classification errors is performed, with a focus on false negative cases. By examining the characteristics of misclassified patients, this analysis aims to identify model limitations and to assess the clinical implications of prediction errors beyond aggregate performance metrics.
Third, the study evaluates the impact of feature engineering on model performance by introducing clinically motivated derived variables and assessing their contribution to predictive accuracy and sensitivity. This analysis provides insights into how enriched data representations influence different classes of machine learning models.

The main contribution of this work lies in the integration of these three aspects within a single, reproducible experimental framework. Unlike many existing studies that primarily report overall accuracy, this study emphasizes recall-driven evaluation, structured error analysis, and the explicit assessment of feature engineering effects, thereby offering a more clinically grounded perspective on the use of machine learning for early cardiovascular risk assessment.

## 1.4 Literature Review

The application of machine learning techniques to heart disease prediction has been extensively explored in the literature over the past two decades. Early studies mainly relied on classical supervised learning algorithms, such as logistic regression, decision trees, k-nearest neighbors, and Naive Bayes classifiers, demonstrating the feasibility of data-driven approaches for cardiovascular risk assessment. However, these works typically employed small benchmark datasets and primarily reported overall accuracy as the main evaluation metric, with limited consideration of clinically critical errors such as false negatives.

More recent studies (2020–2025) have investigated advanced machine learning and ensemble-based approaches, including random forests, gradient boosting methods, and neural networks, reporting improved predictive performance and a better ability to capture non-linear relationships in clinical data [6, 1, 9]. Several of these works acknowledge the limitations of accuracy-based evaluation and advocate for complementary metrics such as recall, F1-score, and AUC to better reflect clinical priorities in cardiovascular screening. Nevertheless, in many cases, evaluation protocols still rely on a single train–test split, lack detailed error analysis, or do not explicitly address the clinical impact of misclassification errors.

Other contributions have focused on gradient boosting and neural network models applied to heart disease datasets, highlighting potential performance gains but also underlining challenges related to model interpretability, robustness, and generalization [2, 11]. In particular, the majority of these studies are conducted on publicly available Kaggle or UCI datasets, which, while useful for benchmarking purposes, may suffer from simplified clinical representations, limited population diversity, and potential selection biases. As a result, the generalizability of the reported findings to real-world clinical settings often remains insufficiently assessed.

Overall, despite the growing body of literature, several methodological gaps persist. Many studies lack external validation or cross-validated evaluation protocols, provide limited analysis of false negative errors, and offer only a superficial discussion of clinical implications. Moreover, few works systematically compare heterogeneous model families under a unified, recall-oriented evaluation framework that explicitly prioritizes patient safety in screening contexts.

Table 1 summarizes representative studies on machine learning-based heart disease prediction, highlighting commonly used datasets, modeling approaches, evaluation metrics, and their main methodological limitations. In contrast to previous studies, the present work proposes a unified and reproducible evaluation framework that systematically compares linear, non-linear, and ensemble-based machine learning

<table><caption>**Table 1:** Summary of representative studies on machine learning-based heart disease prediction</caption><thead><tr><td>Dataset</td><td>Models</td><td>Metrics</td><td>Limitations</td></tr></thead><tbody><tr><td>UCI Heart Disease</td><td>LR, KNN, NB</td><td>Accuracy, Recall</td><td>Small dataset, limited validation</td></tr><tr><td>Cleveland / Statlog</td><td>SVM, DT</td><td>Accuracy, AUC</td><td>Accuracy-oriented evaluation, limited clinical analysis</td></tr><tr><td>Kaggle Heart Disease</td><td>RF, XGBoost</td><td>Accuracy, F1-score</td><td>Single split, no explicit error analysis</td></tr><tr><td>Multi-center clinical data</td><td>Ensemble, NN</td><td>AUC, Recall</td><td>Limited interpretability, restricted availability</td></tr></tbody></table>
models under clinically motivated criteria. By emphasizing recall, structured false negative analysis, and the explicit assessment of feature engineering effects, this study aims to provide a more clinically grounded and methodologically transparent perspective on machine learning-based heart disease prediction.

## 1.5 Experimental Setup

The experimental study is conducted using a publicly available clinical dataset for heart disease prediction, consisting of 918 patient records described by demographic, physiological, and examination-related variables. Each observation includes 11 explanatory features and a binary target variable indicating the presence or absence of heart disease. The dataset is available on the Kaggle platform<fnref n="1" />.

All experiments are implemented in Python using standard machine learning libraries. An exploratory analysis is first carried out to examine variable types, distributions, and potential data quality issues, which informs subsequent preprocessing steps such as categorical encoding, feature normalization, and feature engineering.

For model evaluation, the dataset is divided into training and test sets using a stratified 80/20 split to preserve class proportions. The test set is strictly held out and used only once for final performance assessment. All preprocessing operations and hyperparameter optimization procedures are performed exclusively on the training set, using internal cross-validation, in order to prevent information leakage. A fixed random seed is applied throughout the experiments to ensure reproducibility.

# 2 Data Analysis and Exploration

## 2.1 Analysis of the Dataset Structure

The dataset considered in this study contains 918 patient records and comprises 12 clinical explanatory variables together with a binary target variable indicating the presence or absence of heart disease. The data integrate demographic characteristics, physiological measurements, and results from standard clinical examinations, providing a representative basis for cardiovascular risk prediction.

The explanatory variables are heterogeneous and can be categorized into three groups. Continuous numerical features include age, resting blood pressure, cholesterol level, maximum heart rate achieved, and ST-segment depression (Oldpeak), which exhibit different value ranges and therefore require appropriate scaling prior to model training.

In addition, categorical variables describe chest pain type, resting electrocardiographic results, and ST-segment slope, while binary variables capture information such as sex, elevated fasting blood sugar, exercise-induced angina, and the target outcome. This mixed data structure motivates the use of tailored encoding and normalization strategies, as detailed in the following sections.

## 2.2 Data Distribution Analysis

### 2.2.1 Analysis of the Target Variable

The target variable of this study, denoted by $Y = HeartDisease$, represents the presence or absence of a heart disease. It is a binary variable defined as follows:

$$Y = \begin{cases} 1 & \text{if the patient is diagnosed with heart disease,} \\ 0 & \text{otherwise.} \end{cases}$$

<footnote n="1">¹https://www.kaggle.com/datasets/amirmahdiabbootalebi/heart-disease</footnote>
The dataset includes a total of $N = 918$ patients, among whom $N_0 = 410$ individuals do not present heart disease, while $N_1 = 508$ patients are diagnosed with the condition. The corresponding class probabilities are given by:

$$ \mathbb{P}(Y = 0) = \frac{410}{918} \approx 0.447, \quad \mathbb{P}(Y = 1) = \frac{508}{918} \approx 0.553. $$

The imbalance ratio is defined as:

$$ IR = \frac{N_1}{N_0} \approx 1.24, $$

which indicates a mildly imbalanced dataset.

For a binary variable, the mean corresponds to the proportion of the positive class:

$$ \mu_Y = \frac{1}{N} \sum_{i=1}^{N} Y_i = \mathbb{P}(Y = 1) \approx 0.553. $$

The variance of the target variable is computed as:

$$ \mathrm{Var}(Y) = p(1 - p), $$

where $p = \mathbb{P}(Y = 1)$. This yields:

$$ \mathrm{Var}(Y) \approx 0.247, \quad \sigma_Y = \sqrt{\mathrm{Var}(Y)} \approx 0.497. $$

The distribution of the target variable is illustrated using both a histogram and a boxplot. The histogram reveals a slight predominance of patients with heart disease, while the boxplot confirms the binary nature of the variable and the absence of outliers.

<figure><img src="image_2.png" /><figcaption>Figure 1: Distribution of the target variable *HeartDisease*.</figcaption></figure>

**Interpretation from a Machine Learning Perspective** The relatively balanced distribution of the target variable is advantageous for training classification models. In a medical context, overall accuracy alone is not sufficient to assess model performance. Metrics such as recall and the F1-score are particularly important to reduce false negatives and ensure effective identification of patients at risk.

### 2.2.2 Understanding the Explanatory Variables

The explanatory variables contained in the *heart.csv* dataset describe a range of demographic, clinical, and physiological characteristics that are commonly associated with cardiovascular risk. To facilitate interpretation and provide a clear overview, these variables are summarized in Table 2, together with their data type and clinical meaning.
<table><caption>**Table 2:** Description of the variables in the *heart.csv* dataset.</caption><thead><tr><td>Variable</td><td>Type</td><td>Clinical interpretation</td></tr></thead><tbody><tr><td>Age</td><td>Numerical</td><td>Patient age (in years), a well-known risk factor for cardiovascular disease.</td></tr><tr><td>Sex</td><td>Binary</td><td>Biological sex of the patient (male or female).</td></tr><tr><td>ChestPainType</td><td>Categorical</td><td>Category of chest pain, often related to myocardial ischemia.</td></tr><tr><td>RestingBP</td><td>Numerical</td><td>Resting blood pressure (mmHg), associated with hypertension.</td></tr><tr><td>Cholesterol</td><td>Numerical</td><td>Serum cholesterol level (mg/dL), linked to atherosclerotic risk.</td></tr><tr><td>FastingBS</td><td>Binary</td><td>Fasting blood sugar greater than 120 mg/dL, commonly associated with diabetes.</td></tr><tr><td>RestingECG</td><td>Categorical</td><td>Results of the resting electrocardiogram examination.</td></tr><tr><td>MaxHR</td><td>Numerical</td><td>Maximum heart rate achieved during physical exercise.</td></tr><tr><td>ExerciseAngina</td><td>Binary</td><td>Presence of angina induced by physical exertion.</td></tr><tr><td>Oldpeak</td><td>Numerical</td><td>ST-segment depression induced by exercise, indicating myocardial stress.</td></tr><tr><td>ST_Slope</td><td>Categorical</td><td>Slope of the ST segment observed during exercise.</td></tr><tr><td>HeartDisease</td><td>Binary</td><td>Target variable indicating the presence (1) or absence (0) of heart disease.</td></tr></tbody></table>

### 2.2.3 Visualization of Relationships Between Explanatory Variables and the Target

To investigate the relationships between the explanatory variables and the presence of heart disease, targeted visualizations were employed to compare the distributions of the most informative features with respect to the target variable *HeartDisease*. In accordance with common practices in Machine Learning research articles, only the most relevant and interpretable visualizations are included in the main body of the paper, while additional exploratory figures are provided in the appendix 5.

<figure><img src="image_3.png" /><figcaption>**Figure 2:** Boxplot of Oldpeak values according to heart disease status.</figcaption></figure>

Figure 2 shows that patients diagnosed with heart disease generally exhibit higher *Oldpeak* values, reflecting a more pronounced ST-segment depression during exercise. This observation suggests that *Oldpeak* is a highly discriminative feature for heart disease prediction.
<figure><img src="image_4.png" /><figcaption>**Figure 3:** Boxplot of maximum heart rate (MaxHR) according to heart disease status.</figcaption></figure>

As illustrated in Figure 3, patients with heart disease tend to achieve lower maximum heart rate values compared to individuals without the condition. This pattern indicates that *MaxHR* plays an important role in distinguishing between the two classes.

<figure><img src="image_5.png" /><figcaption>**Figure 4:** Histogram of age distribution by heart disease status.</figcaption></figure>

Figure 4 highlights that patients affected by heart disease are, on average, older than healthy individuals. This confirms age as a major cardiovascular risk factor and a relevant predictive variable for classification tasks.

**Interpretation from a Machine Learning Perspective** The observed differences in the distributions of *Oldpeak* and *MaxHR* indicate a strong discriminative capacity, making these variables particularly informative for classification models. Such separations suggest that both linear and non-linear models can effectively leverage these features. Age provides complementary and clinically meaningful information, contributing to improved overall predictive performance.

Additional exploratory visualizations, including histograms and boxplots for resting blood pressure, cholesterol levels, and other numerical variables, are presented in the appendix to maintain clarity and conciseness in the main text.

## 2.3 Outlier Detection and Treatment

Outlier detection is performed to identify extreme values that may disproportionately influence model training. Given the clinical nature of the dataset, a conservative and interpretable strategy is adopted to avoid removing medically meaningful observations.

For numerical variables, potential outliers are identified using the interquartile range (IQR) criterion. Values below $Q_1 - 1.5 \times IQR$ or above $Q_3 + 1.5 \times IQR$ are flagged as extreme observations. This method
is preferred over parametric approaches such as the z-score, as several clinical variables exhibit skewed and non-Gaussian distributions.

Rather than discarding observations, a clipping strategy is applied, where extreme values are capped at the corresponding IQR thresholds. This choice preserves all patient records while limiting the influence of extreme values during model training. From a clinical perspective, unusually high values of variables such as cholesterol level, resting blood pressure, or ST depression may reflect severe but valid pathological conditions and should therefore not be removed.

To evaluate the impact of outlier treatment, representative models are trained and tested with and without outlier handling. The comparison, summarized in Table 3, indicates that outlier clipping leads to comparable accuracy while slightly improving recall, suggesting a reduction in false negative predictions in a screening context.

<table><caption>**Table 3:** Number of detected outliers per variable using an automated detection method.</caption><thead><tr><td>Variable</td><td>Number of outliers</td></tr></thead><tbody><tr><td>Age</td><td>0</td></tr><tr><td>Sex</td><td>0</td></tr><tr><td>ChestPainType</td><td>0</td></tr><tr><td>RestingBP</td><td>28</td></tr><tr><td>Cholesterol</td><td>183</td></tr><tr><td>FastingBS</td><td>214</td></tr><tr><td>RestingECG</td><td>0</td></tr><tr><td>MaxHR</td><td>2</td></tr><tr><td>ExerciseAngina</td><td>0</td></tr><tr><td>Oldpeak</td><td>16</td></tr><tr><td>ST_Slope</td><td>0</td></tr><tr><td>HeartDisease</td><td>0</td></tr></tbody></table>

**Interpretation from a Machine Learning Perspective** Outliers identified in continuous numerical variables may influence models that are sensitive to extreme values. As a result, only numerical features are considered for outlier handling during the preprocessing stage. Binary and categorical variables are retained without modification to preserve data integrity and clinical interpretability.

# 3 Data Preprocessing

## 3.1 Preprocessing Objectives

Data preprocessing is a critical step in the Machine Learning pipeline, as data quality directly affects model performance, stability, and generalization ability. In a medical context, rigorous preprocessing is particularly important to ensure reliable predictions and to minimize the risk of introducing bias into the decision-making process.

In this study, the preprocessing phase aims to transform the raw dataset into a coherent and model-ready form suitable for classification algorithms. The main preprocessing steps implemented are summarized as follows:

* treatment of outliers identified during the exploratory data analysis;

* normalization of numerical variables to harmonize their scales;

* encoding of categorical variables to make them usable by Machine Learning models;
* preservation of binary variables in their original form;

* preparation of the dataset for the subsequent modeling and evaluation phases.

These steps help reduce the influence of extreme values, improve the convergence of distance-based and gradient-based models, and ensure a fair contribution of all variables. Moreover, appropriate preprocessing enhances the robustness and generalization capability of the models when applied to unseen data.

## 3.2 Training and Test Set Construction

Splitting the dataset into a training set and a test set is a fundamental step to assess the generalization ability of Machine Learning models. This separation allows performance to be evaluated on data that were not used during the learning phase.

The dataset contains a total of 918 observations. It is divided into a training set representing 80% of the data (734 observations) and a test set representing the remaining 20% (184 observations). A stratified splitting strategy is applied in order to preserve the class distribution of the target variable in both subsets.

As a result, the proportion of patients with heart disease (approximately 55.3%) and without heart disease (approximately 44.7%) is maintained in both the training and test sets. This approach prevents the introduction of bias due to an artificial class imbalance.

To ensure the reproducibility of the experiments, a fixed random seed is used during the data splitting process. The training set is exclusively used for model learning and hyperparameter optimization, while the test set is strictly reserved for the final evaluation of model performance.

## 3.3 Handling of Missing Values

Handling missing values is an essential step in data preprocessing, as their presence can negatively affect the learning process of Machine Learning models and introduce bias into the results. A systematic analysis of missing values was therefore conducted across all variables in the dataset.

The results indicate that the *heart.csv* dataset contains no missing values. All 918 observations have complete entries for both the explanatory variables and the target variable. Consequently, the overall missing value rate is equal to 0%.

As a result, no imputation or removal of observations was required. This absence of missing values allows the data to be directly used in the subsequent preprocessing steps, including normalization, categorical encoding, and model training.

**Interpretation for Machine Learning** The absence of missing values eliminates the need for imputation methods that could introduce additional uncertainty or artificially alter the data distribution. As a result, the models can be trained on a complete dataset, which contributes to improved stability, consistency, and reliability of the predictive performance.

## 3.4 Dataset Encoding

Machine Learning algorithms require numerical input data. It is therefore necessary to convert the categorical variables of the dataset into suitable numerical representations while preserving the information they carry.

The categorical variables identified in this study are: *Sex* (M/F), *ChestPainType* (ATA, NAP, ASY, TA), *RestingECG* (Normal, ST, LVH), *ExerciseAngina* (Y/N), and *ST_Slope* (Up, Flat, Down). These variables differ in nature and therefore require specific encoding strategies.

The following encoding methods were applied:
* the binary variables *Sex* and *ExerciseAngina* were encoded using binary encoding (0/1);

* the nominal categorical variables *ChestPainType* (4 categories) and *RestingECG* (3 categories) were encoded using the *One-Hot Encoding* method, generating 4 and 3 new binary features, respectively;

* the ordinal categorical variable *ST_Slope* (3 ordered categories) was encoded using ordinal encoding that respects the natural order of the categories.

Before encoding, the dataset contained 11 explanatory variables. After applying the encoding procedures, the total number of explanatory variables increased to 15. This increase is mainly due to the use of one-hot encoding for nominal categorical variables.

**Interpretation for Machine Learning** The increase in the number of explanatory variables allows a more expressive representation of categorical information without introducing artificial numerical relationships. One-hot encoding is particularly well suited for linear models and distance-based methods, while the ordinal encoding of *ST_Slope* preserves the hierarchical information contained in this variable.

## 3.5 Feature Selection

Feature selection is an important step in the data preprocessing pipeline. Its main objectives are to improve the performance of Machine Learning models, reduce model complexity, and limit the risk of overfitting. In this study, two complementary approaches are applied: variance analysis and correlation analysis between explanatory variables.

### 3.5.1 Variance Analysis

Variance analysis is used to assess the dispersion of each explanatory variable around its mean. A very low variance indicates a quasi-constant variable, which usually provides little information for classification tasks.

Table 4 reports the variance values of all explanatory variables after encoding. Continuous numerical variables such as *Cholesterol*, *MaxHR*, *RestingBP*, and *Age* exhibit high variance values, reflecting substantial variability and a strong potential discriminative power.

Binary variables and features generated through one-hot encoding show lower variance values, ranging between 0.048 and 0.250. This behavior is expected due to their dichotomous nature. However, no variable presents a zero or negligible variance. Consequently, no feature was removed based on the variance criterion.

**Interpretation for Machine Learning** The absence of variables with very low variance indicates that all explanatory features provide potentially useful information for discriminating between classes. Retaining all variables preserves the informational richness of the dataset, which is particularly beneficial for linear models, ensemble-based methods, and neural networks.

### 3.5.2 Correlation Analysis

After checking that the dataset is reasonably balanced, the correlation between the variables is analyzed and visualized using a heatmap generated with the Seaborn library. Pearson's correlation coefficient is computed to quantify the linear relationships between the explanatory variables and the target variable *HeartDisease*. This analysis aims to identify the most influential features and to detect potential redundancy among variables.
<table><caption>**Table 4:** Variance of all explanatory variables after encoding.</caption><thead><tr><td>Variable</td><td>Variance</td></tr></thead><tbody><tr><td>Age</td><td>88.974</td></tr><tr><td>RestingBP</td><td>342.774</td></tr><tr><td>Cholesterol</td><td>11964.891</td></tr><tr><td>FastingBS</td><td>0.179</td></tr><tr><td>MaxHR</td><td>648.229</td></tr><tr><td>Oldpeak</td><td>1.138</td></tr><tr><td>Sex_M</td><td>0.166</td></tr><tr><td>ChestPainType_ATA</td><td>0.153</td></tr><tr><td>ChestPainType_NAP</td><td>0.172</td></tr><tr><td>ChestPainType_TA</td><td>0.048</td></tr><tr><td>RestingECG_NORMAL</td><td>0.240</td></tr><tr><td>RestingECG_ST</td><td>0.156</td></tr><tr><td>ExerciseAngina_Y</td><td>0.241</td></tr><tr><td>ST_Slope_Flat</td><td>0.250</td></tr><tr><td>ST_Slope-Up</td><td>0.245</td></tr></tbody></table>

Table 5 presents the ten highest absolute correlation values observed in the dataset. The strongest correlation is observed between *ST_Slope* and *HeartDisease* ($\rho$ = -0.558771), indicating that a flat or downward ST slope is strongly associated with the presence of heart disease. Other notable correlations include *ExerciseAngina* with *HeartDisease* ($\rho$ = 0.494282) and *Oldpeak* with *HeartDisease* ($\rho$ = 0.403951), confirming the clinical relevance of exercise-induced symptoms and ST depression.

<table><caption>**Table 5:** Top 10 highest correlations observed in the dataset.</caption><thead><tr><td>Variable 1</td><td>Variable 2</td><td>Correlation</td></tr></thead><tbody><tr><td>ST_Slope</td><td>HeartDisease</td><td>-0.558771</td></tr><tr><td>Oldpeak</td><td>ST_Slope</td><td>-0.501921</td></tr><tr><td>ExerciseAngina</td><td>HeartDisease</td><td>0.494282</td></tr><tr><td>ExerciseAngina</td><td>ST_Slope</td><td>-0.428706</td></tr><tr><td>ExerciseAngina</td><td>Oldpeak</td><td>0.408752</td></tr><tr><td>Oldpeak</td><td>HeartDisease</td><td>0.403951</td></tr><tr><td>MaxHR</td><td>HeartDisease</td><td>-0.400421</td></tr><tr><td>ChestPainType</td><td>HeartDisease</td><td>-0.386828</td></tr><tr><td>Age</td><td>MaxHR</td><td>-0.382045</td></tr><tr><td>MaxHR</td><td>ExerciseAngina</td><td>-0.370425</td></tr></tbody></table>

No pair of explanatory variables exhibits an absolute correlation greater than the predefined threshold ($|\rho| > 0.9$). Therefore, no variable is removed based on redundancy criteria.

Figure 5 provides a global visualization of the correlation structure. Most variables show weak to moderate correlations, suggesting limited multicollinearity and supporting their joint use in machine learning models.
<figure><img src="image_6.png" /><figcaption>Figure 5: Correlation between explanatory variables and the target variable.</figcaption></figure>

The heat map highlights that *ExerciseAngina* and *Oldpeak* are positively correlated with the target variable *HeartDisease*.

**Interpretation for Machine Learning** The absence of strong correlations between explanatory variables reduces the risk of multicollinearity, particularly for linear models such as logistic regression. Variables showing moderate correlation with the target, including *ST_Slope*, *ExerciseAngina*, *Oldpeak*, and *MaxHR*, are expected to play a key role in the predictive performance of both linear and non-linear models.

## 3.6 Creation of New Features

The creation of new features, also known as feature engineering, aims to enrich the data representation by incorporating information derived from the original variables. This step makes it possible to explicitly model non-linear relationships and clinically meaningful interactions, which can improve the predictive performance of Machine Learning models.

In this study, three additional explanatory features were constructed based on existing clinical variables.

**HR_Age_Ratio** The variable *HR_Age_Ratio* is defined as the ratio between the maximum heart rate and the patient's age:

$$HR\_Age\_Ratio = \frac{MaxHR}{Age}$$
Descriptive statistics show a mean value of 2.684568 and a standard deviation of 0.886525, with values ranging from 1.030769 to 6.965517.

**Oldpeak_STSlope_Interaction** The variable *Oldpeak_STSlope_Interaction* is defined as:

$$ \text{Oldpeak\_STSlope\_Interaction} = \text{Oldpeak} \times \text{ST\_Slope}_{\text{ordinal}} $$

This feature has a mean of 0.891068 and a standard deviation of 1.495324, with values ranging from -3.000000 to 12.400000.

**BP\_Cholesterol\_Product** The variable *BP\_Cholesterol\_Product* is defined as:

$$ \text{BP\_Cholesterol\_Product} = \text{RestingBP} \times \text{Cholesterol} $$

The descriptive statistics indicate a mean value of 26,524.47 and a standard deviation of 15,297.93, with values ranging from 0.000000 to 78,390.000000.

The introduction of these three features increases the total number of explanatory variables to 16, without introducing any missing values. This feature engineering step enhances the data representation and strengthens the predictive potential of the Machine Learning models used in this study.

## 3.7 Data Normalization

The explanatory variables in the dataset exhibit highly heterogeneous scales. Some variables, such as age or ST-segment depression (*Oldpeak*), take values of only a few units, while others, particularly the blood pressure-cholesterol product, can reach values of several tens of thousands. These scale differences may bias the learning process of Machine Learning models, especially those based on distance metrics or gradient-based optimization.

To ensure comparability between variables and to improve the numerical stability of the algorithms, a normalization step was applied to the numerical features. In this study, Z-score standardization was adopted, which can be done using the *Scikit-learn* library in Python. For a numerical variable *X*, the transformation is defined as:

$$ X_{\text{norm}} = \frac{X - \mu_X}{\sigma_X}, $$

where $\mu_X$ and $\sigma_X$ denote the mean and standard deviation of variable *X*, computed exclusively on the training set.

Normalization was applied to the original numerical variables, namely age, resting blood pressure, cholesterol level, maximum heart rate, and *Oldpeak*, as well as to the newly engineered features introduced in the feature engineering stage: *HR\_Age\_Ratio*, *Oldpeak\_STSlope\_Interaction*, and *BP\_Cholesterol\_Product*. Binary variables and encoded categorical variables were not normalized.

Post-normalization statistics computed on the training set show that the standardized variables have means close to zero and standard deviations close to one. The slight deviation observed (average standard deviation of approximately 1.0007) is due to numerical conventions used in variance estimation and does not affect the validity of the normalization process. Finally, normalization parameters were learned exclusively from the training set and then applied to the test set using the same parameters in order to prevent information leakage (*data leakage*). The dataset is therefore properly prepared for the modeling phase.
<table><caption>Table 6: Statistics of numerical variables after normalization (training set).</caption><thead><tr><td>Variable</td><td>Mean</td><td>Standard Deviation</td></tr></thead><tbody><tr><td>Age</td><td>0.0000</td><td>1.0007</td></tr><tr><td>RestingBP</td><td>0.0000</td><td>1.0007</td></tr><tr><td>Cholesterol</td><td>0.0000</td><td>1.0007</td></tr><tr><td>MaxHR</td><td>0.0000</td><td>1.0007</td></tr><tr><td>Oldpeak</td><td>0.0000</td><td>1.0007</td></tr><tr><td>HR_Age_Ratio</td><td>0.0000</td><td>1.0007</td></tr><tr><td>Oldpeak_STSlope_Interaction</td><td>0.0000</td><td>1.0007</td></tr><tr><td>BP_Cholesterol_Product</td><td>0.0000</td><td>1.0007</td></tr></tbody></table>

# 4 Modeling

## 4.1 Objective and Selection of Machine Learning Models

The objective of this section is to develop and compare several supervised Machine Learning models for predicting the presence of heart disease using clinical patient data. The problem is formulated as a binary classification task, where the target variable indicates whether a patient is affected by a cardiovascular condition.

The selection of models aims to balance predictive performance, robustness, and interpretability, which is particularly important in a medical context. Models of increasing complexity are considered in order to capture both linear and non-linear relationships between the explanatory variables and the target variable.

Logistic Regression is employed as a reference model due to its simplicity and its widespread use in medical and epidemiological studies. The k-nearest neighbors (KNN) algorithm is included to evaluate a distance-based approach, highlighting the impact of feature scaling on model performance. Support Vector Machines (SVM) are selected for their ability to construct optimal decision boundaries and to model non-linear patterns through kernel functions.

Ensemble learning techniques, namely Random Forest and XGBoost, are evaluated for their capacity to model complex interactions between variables while reducing the risk of overfitting. These models also provide valuable insights into feature importance. Finally, a multilayer perceptron (MLP) is considered to assess the ability of neural networks to learn highly non-linear relationships in tabular clinical data.

Model performance is assessed using evaluation metrics adapted to the medical domain, with particular emphasis on recall and the F1-score in order to minimize false negatives and improve the detection of at-risk patients.

## 4.2 Defining a Reliable and Reproducible Evaluation Framework

The performance of the Machine Learning models was assessed using a rigorous experimental protocol based on a strict separation between the training set (80%, corresponding to 734 observations) and the test set (20%, corresponding to 184 observations). The results presented in this subsection are obtained exclusively on the test set, which was never used during the training phase.

### Detailed Analysis of the Confusion Matrix

The confusion matrix obtained for the logistic regression model is given by:

$$ \begin{pmatrix} 67 & 15 \\ 7 & 95 \end{pmatrix} $$
where rows correspond to the true classes and columns correspond to the predicted classes. The entries
of the matrix can be interpreted as follows:

• $TN = 67$: patients correctly identified as not having heart disease,

• $FP = 15$: healthy patients incorrectly classified as having heart disease,

• $FN = 7$: patients with heart disease that were not detected by the model,

• $TP = 95$: patients with heart disease correctly identified.

**Clinical interpretation.** In a medical context, false negatives ($FN$) represent critical cases, as they correspond to patients who are actually affected but would not be identified by the prediction system. In this case, the number of false negatives is limited to 7 out of 102 patients with heart disease, which represents a satisfactory result for a screening-oriented application. False positives, although present, are generally considered less severe, as they typically lead to additional clinical examinations rather than a missed diagnosis.

**Interpretation of Evaluation Metrics**

Model performance is further analyzed using standard Machine Learning metrics, interpreted in light of
medical constraints.

**Class 1: presence of heart disease.** For the positive class, the model achieves a recall of 0.93, indicating that 93% of patients with heart disease are correctly detected. This high level of sensitivity is particularly important in a clinical context, where minimizing false negatives is a priority. The precision reaches 0.86, meaning that most patients predicted as diseased are indeed affected. The resulting F1-score of 0.90 confirms a strong balance between precision and recall.

**Class 0: absence of heart disease.** For the negative class, the recall is 0.82, reflecting a satisfactory ability of the model to identify healthy patients. The number of observed false positives remains moderate and acceptable in a clinical application, where over-detection is generally preferable to missing patients who are truly at risk.

**Overall accuracy.** The overall accuracy achieved is 0.88. Although this metric provides a general indication of model performance, it is interpreted with caution due to the slight class imbalance. In this study, accuracy is therefore considered a secondary metric compared to the recall of the positive class.

Overall, these results show that logistic regression constitutes a robust baseline model, offering a good trade-off between predictive performance, stability, and interpretability, and meeting the requirements of medical screening applications.

## 4.3 Training and Evaluation of Multiple Models Using the Proposed Framework

Based on the evaluation protocol defined previously, several supervised Machine Learning models were trained and evaluated on the same test set to ensure a fair and consistent comparison. The considered models include Logistic Regression, K-Nearest Neighbors (KNN), Support Vector Machines (SVM), Random Forest, XGBoost, and a Multilayer Perceptron (MLP).
## Analysis of Confusion Matrices

The confusion matrices obtained for each model on the test set are summarized using the (TN, FP, FN, TP) values. Logistic Regression yields the confusion matrix $\begin{pmatrix} 67 & 15 \\ 7 & 95 \end{pmatrix}$, indicating a very low number of false negatives (7 undetected patients), which is highly desirable in a medical screening context.

The KNN model produces $\begin{pmatrix} 69 & 13 \\ 12 & 90 \end{pmatrix}$, showing an increase in false negatives, which may be problematic from a clinical perspective. The SVM achieves $\begin{pmatrix} 66 & 16 \\ 8 & 94 \end{pmatrix}$, offering a reasonable balance between sensitivity and specificity.

The Random Forest model results in $\begin{pmatrix} 69 & 13 \\ 9 & 93 \end{pmatrix}$, confirming its robustness and its ability to limit critical errors. XGBoost and the MLP yield $\begin{pmatrix} 71 & 11 \\ 12 & 90 \end{pmatrix}$ and $\begin{pmatrix} 70 & 12 \\ 12 & 90 \end{pmatrix}$ respectively, with fewer false positives but a higher number of false negatives.

From a clinical standpoint, false negatives are the most critical errors, as they correspond to patients with heart disease who are not detected by the model. Models that minimize this type of error are therefore preferred.

## Quantitative Performance Comparison

Table 7 summarizes the performance of each model in terms of accuracy, precision, recall, and F1-score.

<table><caption>**Table 7:** Comparative performance of the evaluated Machine Learning models on the test set.</caption><thead><tr><th>Model</th><th>Accuracy</th><th>Precision</th><th>Recall</th><th>F1-score</th></tr></thead><tbody><tr><td>Logistic Regression</td><td>0.8804</td><td>0.8636</td><td>0.9314</td><td>0.8962</td></tr><tr><td>KNN</td><td>0.8641</td><td>0.8738</td><td>0.8824</td><td>0.8780</td></tr><tr><td>SVM</td><td>0.8696</td><td>0.8545</td><td>0.9216</td><td>0.8868</td></tr><tr><td>Random Forest</td><td>0.8804</td><td>0.8774</td><td>0.9118</td><td>0.8942</td></tr><tr><td>XGBoost</td><td>0.8750</td><td>0.8911</td><td>0.8824</td><td>0.8867</td></tr><tr><td>MLP</td><td>0.8696</td><td>0.8824</td><td>0.8824</td><td>0.8824</td></tr></tbody></table>

## Machine Learning and Clinical Interpretation

The comparative analysis shows that Logistic Regression achieves the highest recall (0.93), meaning that it correctly identifies the vast majority of patients with heart disease. This property is particularly important in screening applications, where minimizing false negatives is a priority.

The Random Forest model offers a well-balanced trade-off between recall (0.91), precision (0.88), and overall stability, making it a strong alternative. The SVM also exhibits high sensitivity, but with a slightly higher number of false positives. XGBoost and the MLP achieve good overall performance; however, their lower recall makes them less suitable in a safety-critical medical context.

Overall, although non-linear models provide competitive results, Logistic Regression and Random Forest appear to be the most appropriate choices for this problem, due to their favorable balance between predictive performance, interpretability, and clinical reliability.

## ROC Curve Analysis

To further evaluate the discriminative ability of the different models, Receiver Operating Characteristic (ROC) curves were plotted on the test set. These curves illustrate the evolution of the true positive rate (TPR) as a function of the false positive rate (FPR) for different decision thresholds.
These metrics are defined as:

$$TPR = \frac{TP}{TP + FN}, \quad FPR = \frac{FP}{FP + TN}$$

Figure 6 shows the ROC curves for all evaluated models. The diagonal line corresponds to a random classifier, while curves above this line indicate better-than-random discrimination.

All models achieve high Area Under the Curve (AUC) values, confirming their relevance for this classification task. Logistic Regression and Random Forest exhibit curves closest to the top-left corner, reflecting an effective compromise between sensitivity and specificity. This behavior is particularly suitable for medical applications, where detecting as many affected patients as possible while limiting false alarms is essential.

<figure><img src="image_7.png" /><figcaption>Figure 6: ROC curves for the different Machine Learning models evaluated on the test set.</figcaption></figure>

## 4.4 Hyperparameter Optimization of Selected Models

After the initial evaluation of the different Machine Learning models, a hyperparameter optimization step was conducted to further improve the performance of the most relevant models while ensuring good generalization capabilities. This step is essential, as hyperparameters directly control model complexity and influence the bias-variance trade-off.

In this study, hyperparameter optimization was applied to Logistic Regression and Random Forest models, which demonstrated strong performance in previous experiments. A grid search strategy combined with cross-validation was used to identify the optimal hyperparameter configurations. Given the medical context, the optimization criterion focused on the recall of the positive class, corresponding to the detection of patients with heart disease.

For Logistic Regression, the grid search configuration presented in Table 8 explored different values of the regularization parameter C and penalty types compatible with the selected solver. The optimal hyperparameters obtained were C = 0.1, an $\ell_2$ penalty, and the liblinear solver. This configuration introduces stronger regularization, helping to reduce overfitting while maintaining a high detection rate for at-risk patients.
<table><caption>**Table 8:** Grid search configuration for Logistic Regression hyperparameter optimization.</caption><thead><tr><td>Hyperparameter</td><td>Tested values</td></tr></thead><tbody><tr><td>C</td><td>{0.01, 0.1, 1, 10, 100}</td></tr><tr><td>Penalty</td><td>{l<sub>1</sub>, l<sub>2</sub>}</td></tr><tr><td>Solver</td><td>liblinear</td></tr></tbody></table>

For the Random Forest model, the optimization focused on the number of trees, the maximum tree depth, and the minimum number of samples required to split a node. The optimal configuration consisted of 200 trees, no restriction on maximum depth, and a minimum of five samples per split. This setting allows the model to capture complex non-linear relationships while controlling variance.

The numerical performances obtained after optimization are reported in Table 9. The optimized Logistic Regression model achieves a recall of 0.901961 for the positive class, while the optimized Random Forest reaches a higher recall of 0.921569, indicating superior detection capability for patients with heart disease. The Random Forest model also attains a higher overall accuracy of 0.880435.

<table><caption>**Table 9:** Numerical performance of optimized models on the test set.</caption><thead><tr><td>Model</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>F1-score</td></tr></thead><tbody><tr><td>Logistic Regression (Optimized)</td><td>0.858696</td><td>0.851852</td><td>0.901961</td><td>0.876190</td></tr><tr><td>Random Forest (Optimized)</td><td>0.880435</td><td>0.870370</td><td>0.921569</td><td>0.895238</td></tr></tbody></table>

In summary, hyperparameter optimization improves both model stability and reliability. The optimized Random Forest offers the best overall trade-off between recall, precision, and F1-score, making it the most suitable model for clinical decision support. The optimized Logistic Regression remains a simple, robust, and highly interpretable alternative, which is a key advantage in medical applications.

## 4.5 Error analysis and iterative performance improvement

Error analysis is a crucial step in the development of a Machine Learning system applied to medical diagnosis. Unlike global metrics such as accuracy or F1-score, it enables a precise identification of the types of errors made by the models and an assessment of their clinical impact.

This analysis is based on a detailed examination of the confusion matrices of the optimized models, namely logistic regression and Random Forest. Errors are decomposed into false positives (FP), corresponding to healthy patients incorrectly predicted as diseased, and false negatives (FN), corresponding to patients with heart disease who are not detected by the model. In a medical context, false negatives represent the most critical type of error.

For the optimized logistic regression model, the obtained confusion matrix is:

$$ \begin{pmatrix} TN = 66 & FP = 16 \\ FN = 10 & TP = 92 \end{pmatrix} $$

The false negative rate is computed as:

$$ FN\_rate = \frac{FN}{FN + TP} = \frac{10}{10 + 92} \approx 0.098 $$

indicating that approximately 9.8% of patients with heart disease are not detected by the model. The false positive rate is given by:

$$ FP\_rate = \frac{FP}{FP + TN} = \frac{16}{16 + 66} \approx 0.195 $$
For the optimized Random Forest model, the confusion matrix is:

$$ \begin{pmatrix} TN = 68 & FP = 14 \\ FN = 8 & TP = 94 \end{pmatrix} $$

The corresponding false negative rate becomes:

$$ FN\_rate = \frac{8}{8 + 94} \approx 0.078 $$

and the false positive rate:

$$ FP\_rate = \frac{14}{14 + 68} \approx 0.171 $$

These results show that the optimized Random Forest reduces both false negatives and false positives compared to logistic regression. From a clinical perspective, the reduction in false negatives is particularly important, as it lowers the risk of undiagnosed heart disease patients, which could otherwise lead to delayed medical intervention.

A qualitative analysis of the misclassified observations reveals that these errors mainly concern patients with intermediate clinical profiles, characterized by values close to the decision thresholds for key variables such as maximum heart rate, Oldpeak, or resting blood pressure. These cases highlight the inherent difficulty of the classification task and the limitations of predictive models when dealing with borderline clinical situations.

This error analysis provides valuable insights for revisiting earlier stages of the pipeline in order to further improve system performance. Several improvement strategies can be considered, including refined preprocessing steps, the creation of more discriminative features, class rebalancing, or a more targeted hyperparameter optimization with a stronger penalty on false negatives.

In summary, error analysis emphasizes the importance of an iterative approach, in which model outcomes guide continuous improvements to both the dataset and the algorithms. This methodology contributes to the design of a more robust prediction system, better suited to the constraints of medical diagnosis and capable of evolving with the integration of new clinical data. These results naturally lead to a final decision regarding the most suitable model for clinical deployment, discussed in the next section.

## 4.6 Decision Making

The final decision is based on a joint analysis of numerical performance metrics, error analysis, and clinical constraints related to the diagnosis of heart disease. In this context, priority is given to minimizing false negatives, as a failure to detect the disease may have serious consequences for the patient.

The optimized results show that the Random Forest model achieves better overall performance than the optimized logistic regression. In particular, the Random Forest reaches an accuracy of 0.880, a recall of 0.922, and an F1-score of 0.895, compared to 0.859, 0.902, and 0.876 respectively for logistic regression.

The false negative rate is defined as:

$$ FN\_rate = \frac{FN}{FN + TP} $$

For the optimized logistic regression model, this rate is:

$$ FN\_rate = \frac{10}{10 + 92} \approx 0.098039 $$
For the optimized Random Forest model, it becomes:

$$FN\_rate = \frac{8}{8 + 94} \approx 0.078431$$

These results indicate that the Random Forest reduces the risk of undetected heart disease patients by approximately two percentage points. Although this improvement may appear moderate in absolute terms, it is clinically significant, as reducing false negatives is a primary objective in medical diagnosis.

Consequently, the optimized Random Forest is selected as the final model in this study. It provides the best trade-off between sensitivity, precision, and F1-score, while demonstrating a stronger ability to identify high-risk patients. The optimized logistic regression model remains a valuable alternative for applications requiring high interpretability of decision-making.

This final decision is grounded in both quantitative metrics and clinical considerations, ensuring the relevance and reliability of the selected model for real-world decision-support applications in medical diagnosis.

A more refined analysis of decision thresholds could be considered in a clinical deployment setting in order to further prioritize sensitivity. However, in this study, the standard threshold of 0.5 proved sufficient to effectively discriminate patients at risk.

# 5 Conclusion and future work

This study shows that machine learning methods can be effectively used to predict heart disease, which remains a major health issue worldwide. The evaluated models achieved good performance using the available clinical features, highlighting the relevance of data-driven approaches in medical prediction tasks. As machine learning research advances, such methods are expected to play an increasingly important role in healthcare. Overall, the results confirm that machine learning can support early detection of heart disease and help reduce the risks associated with late diagnosis.

# Limitations and Future Research Directions

Despite the promising results obtained in this study, several limitations should be acknowledged. First, the dataset used is of moderate size and originates from a single source, which may restrict the generalizability of the proposed models to broader and more diverse patient populations. In addition, the demographic representation within the dataset is limited, potentially introducing bias in the predictive performance of the models.

Future research should address these limitations by validating the proposed approaches on larger, multi-center, and demographically diverse datasets to ensure robustness and clinical reliability.

Another important direction concerns model interpretability. Integrating explainable artificial intelligence (XAI) techniques, such as SHAP values, would provide greater transparency in complex models like Random Forest and facilitate their adoption in clinical settings. Finally, the development of real-time prediction systems or mobile health applications could enable practical deployment of the proposed models in primary healthcare environments and support early screening initiatives.

Overall, this study highlights the strong potential of machine learning approaches to support cardiovascular disease prediction. By providing accurate and data-driven decision support, such models may assist healthcare professionals in early diagnosis and contribute to reducing the global burden of cardiovascular diseases.
A Additional Exploratory Visualizations

This appendix presents complementary histograms and boxplots illustrating the distributions of numerical variables used in the study.

<figure><img src="image_8.png" /><figcaption>**Figure 7:** Histogram of resting blood pressure distribution.</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>**Figure 8:** Histogram of serum cholesterol levels.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>**Figure 9:** Histogram of maximum heart rate distribution.</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>**Figure 10:** Histogram of Oldpeak (ST depression) values.</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>**Figure 11:** Boxplot of age distribution.</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>**Figure 12:** Boxplot of resting blood pressure distribution.</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>**Figure 13:** Boxplot of cholesterol distribution.</figcaption></figure>
These figures provide complementary insights into the distributions and variability of numerical vari-
ables and are included for completeness.

References

[1] Halah A. Al-Alshaikh, Abdul Khader Jilani Saudagar, Hatoon S. AlSagri, Abeer A. AlSanad, Prabu P, and Ramesh Chandra Poonia. Comprehensive evaluation and performance analysis of machine learning in heart disease prediction. *Scientific Reports*, 14(1):7819, 2024.

[2] G. Alwakid, F. Ul Haq, N. Tariq, et al. Optimized machine learning framework for cardiovascular disease diagnosis: a novel ethical perspective. *BMC Cardiovascular Disorders*, 25(123):1–17, 2025.

[3] B. Kaur and W. Singh. review on heart disease prediction system using data mining techniques. *International journal on recent and innovation trends in computing and communication*, 2(10):003-3008, 2014.

[4] Ali Azimi Lamir, Shiva Razzagzadeh, and Zeynab Rezaei. A comprehensive machine learning framework for heart disease prediction: Performance evaluation and future perspectives. *arXiv preprint*, abs/2505.09969, 2025.

[5] Bote M. P. Medhekar, D. S. and S. D. Deshmukh. Heart disease prediction system using naive bayes.
*Int. J. Enhanced Res. Sci. Technol. Eng*, 2(3), 2013.

[6] Thirumalai C. Mohan, S. and G. Srivastava. Effective heart disease prediction using hybrid machine learning techniques. *IEEE Access*, 7:81542-81554, 2019.

[7] World Health Organization. Cardiovascular diseases (CVDs). Retrieved from https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds). 2021.

[8] M. U. Rehman, S. Naseem, A. Butt, et al. Predicting coronary heart disease with advanced machine learning classifiers for improved cardiovascular risk assessment. *Scientific Reports*, 15(1):13361, 2025.

[9] B. E. Sianga, M. C. Mbago, and A. S. Msengwa. Predicting the prevalence of cardiovascular diseases using machine learning algorithms. *Informatics in Medicine Unlocked*, 25(100103):1–12, 2025.

[10] World Health Organization. Cardiovascular diseases (cvds): Fact sheet. *World Health Organization*, 2025.

[11] Hongyu Zhou. Machine learning methods for heart disease prediction. *International Journal of Advanced Computer Science and Applications (ScitePress proceedings)*, 14(9):1-10, 2024.