## 4 Results and Discussion
### XAI-Based Feature Importance Analysis
Figure 12 depicts the waterfall plot, which clearly shows how individual features influence the prediction of a heart attack. The strongest contributors to a higher likelihood of a heart attack are the absence of major vessel narrowing (ca = 0, +0.11), atypical angina (cp = 2, +0.10), and a high maximum heart rate (thalach = 174, +0.08). Additionally, a flat ST-segment slope (slope = 2, +0.07) and a fixed heart defect (thal = 2, +0.06) further push the model toward predicting a heart attack. Meanwhile, features like gender (sex = 1, -0.03) and other minor factors slightly reduce the risk, but their impact is relatively small compared to the risk-driving features. The final prediction (f(x) = 0.956) indicates a high likelihood of a heart attack, with the sum of all feature contributions leading to this outcome. Figure 13 shows the SHAP dependence plots depicting how age and chest pain type (cp) influence heart attack predictions, showing their interactions with other features. The first plot shows that younger age reduces heart attack risk, while older age increases it, with a sharp rise in risk above 60. The second plot highlights that typical or no chest pain (low cp) has little impact, while atypical or non-anginal pain (high cp) significantly raises the risk, especially when combined with a higher number of blocked vessels (ca). Age and chest pain type are thus crucial predictors, with age steadily increasing risk and high cp values amplifying it further. Figure 9: Feature summary plot for Class 0. Figure 11: Feature shape force plot. Figure 10: Shape value analysis for both classes (**a**) Class 0 (Normal) and (**b**) Class 1 (heart attack). It is important to note that LIME and SHAP provide complementary perspectives on feature importance. LIME explains local predictions by approximating the model's behavior for individual instances, while SHAP offers global feature attributions across the entire dataset. We have ensured that the combined insights from both methods align with clinically validated risk factors and provide a holistic understanding for practitioners. Based on the analysis of the results from various XAI techniques, such as SHAP and LIME, several key features emerged as significant predictors of heart attack risk. Age consistently played a crucial role, with its increasing values contributing to a higher risk, particularly for individuals over 60 years old. Chest pain type (cp) was another dominant feature, with atypical or non-anginal pain (high cp) significantly amplifying the risk of a heart attack, especially when combined with other factors like the number of blocked vessels (ca). Other critical features identified included oldpeak (ST depression), which strongly influenced heart attack predictions, and maximum heart rate (thalach), which helped differentiate between normal and abnormal heart conditions. These features consistently appeared as high-impact contributors in the model's decision-making process. Further examination of the feature interactions revealed that cholesterol levels (chol) and resting blood pressure (trestbps) also had important roles, though their influence was more moderate compared to the primary predictors. Slope, thalassemia test results (thal), and sex were identified as contributors that, when combined with other factors, could shift the prediction toward higher or lower heart attack risk. The combination of age, cp, and ca were especially influential, demonstrating a complex interaction between demographic factors, clinical indicators, and physiological measurements in predicting heart attack likelihood. These insights underscore the importance of incorporating these critical features for more accurate and explainable heart disease risk assessments. Figure 12: Shape waterfall plot.