## 4 Results and Discussion
### XAI-Based Feature Importance Analysis  
The main focus of this study is to integrate high-performing AI models with real-world applicability, ensuring that AI-driven heart attack prediction is both accurate and interpretable. To achieve this, (XAI) techniques, specifically LIME and SHAP, are applied to the optimal classification model, ANN. This study focuses on enhancing model interpretability using the UCI Heart Disease dataset. LIME provides localized explanations by analyzing individual predictions, while SHAP offers global insights into feature importance, interactions, and subgroup trends. By integrating both methods, this research ensures greater transparency, reliability, and interpretability, enabling healthcare professionals to make informed, data-driven decisions for improved patient outcomes. In the rest of the section, we will examine the dataset across various XAI models in order to identify important features that are most important in regard to heart attack prediction. Figure 5 shows the LIME analysis of the ANN model for heart attack risk assessment. The graph shows that one of the most useful features among all the features is \"oldpeak\", which reveals its strong impact on the prediction. Moreover, \"cp\" and \"thalach\" also contribute to model decisions, thus illustrating their clinical significance. Notably, the most important features are slope (weight = 0.08) and that (weight \(\approx\) 0.07), both showing \begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithm** & **Training Time (s)** & **Testing Time (s)** \\ \hline Adaboost & 61 & 6.1 \\ \hline Bagging & 2 & 0.3 \\ \hline RF & 2 & 0.3 \\ \hline KNN & 15 & 3 \\ \hline LR & 15 & 1.5 \\ \hline NB & 22 & 1.2 \\ \hline SVM & 14 & 2 \\ \hline Vote & 22 & 2.5 \\ \hline ANN & 69 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Training and testing time of different ML algorithms applied on dataset after applying SMOTE. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Fold** & **Precision (\%)** & **Recall (\%)** & **F1-Measure (\%)** & **Accuracy (\%)** & **ROC Value (\%)** \\ \hline
1 & 96.5 & 96.0 & 96.0 & 96.5 & 100 \\ \hline
2 & 96.0 & 95.5 & 95.5 & 96.0 & 100 \\ \hline
3 & 95.8 & 95.4 & 95.4 & 95.8 & 100 \\ \hline
4 & 96.2 & 96.0 & 96  
negative correlations and having the greatest influence on the prediction of heart disease. The demographic factors \"age\" and \"sex\" are moderately important, as already shown to be the case with cardiovascular health. Finally, the importance of traditional metrics such as \"trestbps\", \"chol\", and \"restecg\" is lower in the model, which implies that these metrics do not have a prominent impact on the predictive outputs of the proposed model. Figure 6 showcases the LIME-based local explanation of the ANN model's prediction. It indicates an 85% probability for the \"Normal\" class and 15% for \"Abnormal\". Features supporting \"Abnormal\" include age (0.07 \(<\) age \(\leq\) 0.73) and fasting blood sugar (fbs \(\leq-\)0.39), suggesting slight heart condition risks. Conversely, slope (\(\leq\)1.02), that (\(\leq\)\(-\)0.50), and maximum heart rate (thalach \(>\) 0.72) strongly oppose the \"Abnormal\" prediction, associating them with better cardiac health. Resting ECG (restecg \(\leq\) 0.96) and cholesterol (chol \(\leq-\)0.68) provide minor negative influences. The explanation highlights slope, that, and thalach as key in reducing heart attack risk. This transparency enhances trust in the ANN's decision-making for medical professionals. Figure 7 visualizes local model explanations by displaying feature weights for a specific prediction. \"Age\" (0.07 \(<\) age \(\leq\) 0.73) is the top positive contributor to the \"Abnormal\" class, indicating a higher attack risk. The strongest negative contributors favoring the \"Normal\" class are \"slope\" (\(-\)0.58 \(<\) slope \(\leq\) 1.02) and \"thal\" (thal \(\leq-\)0.50), suggesting a lower risk.