## 3 Results
### Raw Data  
At the onset of our study, we applied our ML algorithms on the raw dataset. As was expected, the inherent imbalance within the data posed a substantial obstacle, hindering the models' ability to accurately identify positive observations of heart disease. This imbalance led to a bias favoring the classification of most observations as not having heart disease, thereby inflating apparent accuracy metrics while obscuring poor performance on the minority class. Recognizing the critical nature of this challenge, we undertook measures to address it, resulting in noteworthy improvements, as elaborated in subsequent sections. To ensure robust estimations of model performance, we employed a stratified 5-fold cross-validation across all models. This technique, by partitioning the dataset into multiple folds and training/evaluating the model on each combination, provided a comprehensive assessment of how well the models generalized to different subsets of the data. The evaluation outcomes of the trained ML models on both the testing and training sets are summarized in Table 2.  
Notably, initial observations revealed instances of overfitting in the decision tree and random forest models, leading to poor generalization of unseen data. Additionally, while many models achieved high accuracy rates (approximately 92%), their performance in correctly predicting positive cases was notably deficient. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Accuracy/** & **Recall/** & **Precision/** & **F1-Score/** & **AUC/** \\  & **Training Accuracy** & **Training Recall** & **Training Precision** & **Training F1-Score** & **Training AUC** \\ \hline Logistic Regression & 0.92/0.93 & 0.03/0.06 & 0.47/0.51 & 0.06/0.12 & 0.80/0.84 \\ Decision Tree & 0.86/1.00 & 0.23/1.00 & 0.19/1.00 & 0.21/1.00 & 0.57/1.00 \\ Random Forest & 0.92/1.00 & 0.03/1.00 & 0.47/1.00 & 0.06/1.00 & 0.80/1.00 \\ Gradient Boosting & 0.92/0.92 & 0.05/0.05 & 0.49/0.55 & 0.09/0.09 & 0.83/0.84 \\ XGBoost & 0.92/0.92 & 0.05/0.09 & 0.46/0.75 & 0.10/0.17 & 0.83/0.88 \\ CatBoost & 0.92/0.93 & 0.04/0.11 & 0.47/0.84 & 0.09/0.19 & 0.83/0.87 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance results on raw data. This discrepancy, wherein models exhibited high accuracy but low recall rates, underscores concern regarding the potential oversight of a significant portion of positive cases--an issue of paramount importance in predictive healthcare analytics. For instance, as depicted in Figure 3, the confusion matrix for logistic regression, which exhibited relatively better performance, revealed 7247 missed positive cases. Such oversights could carry significant consequences in real-world scenarios, prompting us to prioritize the enhancement of model sensitivity. While default values often yield satisfactory results, the art of hyperparameter tuning unveils the potential for more accurate predictions. By reviewing the documentation of each algorithm, the bibliography, and by using some optimizing algorithms, we tried to find the right parameter grid to improve our models' performance. The performance results that the models achieved can be seen in Table 3.  
Upon examination of the results, it is evident that there is negligible variance among the outcomes for the remaining models, except for XGBoost and CatBoost. Notably, these two models exhibited a noteworthy increase in the achieved recall, with CatBoost reaching an impressive 77% while preserving an excellent accuracy rate. This substantial escalation from the initial 4% underscores the significant impact of tuning these models with the right hyperparameters. It demonstrates that, when finely tuned, CatBoost can identify a considerable number of individuals prone to CVD with a level of accuracy that extends beyond mere satisfaction. The dual-axis visualization in Figure 4 offers insights into how each model navigates the trade-off between overall accuracy and the adeptness in capturing positive cases, recall.