Cheragh Hussain1, Muhammad Idrees Khan2, Nazeef Ullah3, Abid Ullah3, Rayan Shah3, Aurangzeb Khan4
1Department of Cardiology, Khyber Girls Medical College, Peshawar; 2Peshawar Regional Blood Centre, Khyber Pakhtunkhwa; 3Department of Cardiology, Post Graduate Medical Institute (PGMI), Peshawar; Department of Pathology, Swat Medical College, Saidu, Swat
Objective: Pakistan and the rest of the world suffer from a high rate of acute myocardial infarctions (AMIs). In this study, we employed a machine learning model to predict mortality in patients with Acute Myocardial Infarction (AMI). By analyzing various variables, they assessed the impact of these factors on the predictive models, highlighting the potential of machine learning in improving mortality prediction and informing clinical decision-making in AMI cases.
Methodology: This study conducted three experiments using a Kaggle dataset to predict mortality in Acute Myocardial Infarction (AMI) patients with machine learning. Relevant input features were selected, and three models (SVM, DT, KNN) classified mortality status. Model performance was rigorously evaluated with metrics like Accuracy, AUC, Precision, Recall, and F1-score. Data preprocessing, including handling missing values and normalization, preceded model training.
Results: Among the evaluated models, the Support Vector Machine (SVM) exhibited the highest accuracy of approximately 87.66% and demonstrated robust discrimination capabilities, with an AUC score of 0.796. Precision, recall, and F1 scores indicated a balanced trade-off between correctly identifying negative outcomes and effectively capturing positive cases.
Conclusion: The SVM model emerged as the most promising classifier, showcasing strong potential for predicting patient mortality in the context of AMI. However, further refinements and optimizations may be necessary to enhance model performance, ensuring its clinical relevance and utility in real-world medical scenarios.
Keywords: Machine Learning, Acute Myocardial Infarction, Coronary Artery Disease, Predictive models
Cardiovascular diseases are responsible for a significant proportion of deaths in both the European Union and the United States, accounting for approximately 30% of total mortality. This highlights the substantial impact of these diseases on public health1,3. The primary cause of death worldwide and hospitalization is AMI. This cardiovascular disease has significant implications for public health, necessitating the development of predictive models using machine learning techniques to analyze mortality rates and identify factors that impact patient outcomes (3),(4). The COVID-19 pandemic highlighted the importance of maintaining high-quality acute care for patients with AMI. During this period, there were significant increases in AMI mortality rates, emphasizing the need for effective and timely medical intervention to mitigate adverse outcomes.3,6
In recent decades, advancements in technology, optimization of therapeutic approaches, implementation of preventive policies, improvements in pre-hospital care, and the establishment of guidelines have had a significant impact on reducing mortality rates and hospital stays in various medical conditions, including AMI. These efforts have contributed to improved patient outcomes and enhanced healthcare practices.3,7 AMI mortality rate after 30 days in the hospital, which is indicative of the quality of care and clinical interventions, exhibits significant variation among European Union (EU) countries. This suggests that the provision of care and clinical interventions for AMI patients differs across EU countries, leading to varying mortality outcomes within 30 days.8,9 The text states that the lowest 30-day in-hospital mortality rates for AMI are observed in countries such as The Netherlands, Sweden, Slovenia, Denmark, Poland, and Ireland, with rates below 5.0%. These variations in mortality rates among EU countries highlight the influence of different factors and healthcare systems on AMI outcomes.3 The mortality rate of AMI is influenced by various factors, as stated by the European Society of Cardiology. Several factors influence the risk of death, including age, sex, comorbidities, high heart rate, and changes in certain laboratory findings. Understanding and monitoring these risk factors is crucial in managing AMI patients and improving outcomes.10,11
During a medical emergency, it is crucial to manage factors that influence mortality in patients with AMI. Early identification of symptoms and prompt intervention can help prevent or delay the progression of the condition, potentially reducing the high mortality rate observed within the first few hours after symptom onset. This highlights the importance of timely medical care and interventions in improving outcomes for AMI patients12,13,14.
In the digital health era, the availability of vast amounts of data has opened up opportunities for leveraging machine learning (ML) and data mining algorithms to enhance clinical decision support. These technologies have the potential to analyze and interpret complex healthcare data, aiding in early screening, diagnosis, disease prevention, treatment management, and improved patient outcomes. In this study, ML and data mining algorithms are being used to develop a model for predicting mortality in patients with AMI.15 In the context of cardiovascular diseases, the use of machine learning (ML) and data mining algorithms has shown promise in various aspects of patient care, such as early screening, diagnosis, and disease prevention by identifying risk factors, treatment management, monitoring with improved pharmacovigilance and patient safety, and ultimately, improved outcomes and care provision. These advancements in ML have demonstrated their potential to outperform traditional statistical models in predicting patient mortality, readmission, and the occurrence of arrhythmia after AMI, across different populations and settings.13,19
Cardiovascular diseases are multifaceted and diverse, arising from a combination of genetic, environmental, and behavioral factors. Consequently, there is an increasing demand to analyze data from various sources, including administrative records, laboratory tests, and medical imaging, to interpret, diagnose, and make informed decisions regarding these conditions. This comprehensive data analysis approach enables a deeper understanding of cardiovascular diseases and facilitates personalized treatment strategies.10,11 In addition, data analysis in healthcare can lead to resource optimization, improved patient experiences, and enhanced interactions with healthcare organizations. By leveraging sophisticated technology, such as machine learning and data mining algorithms, waste reduction can be achieved, ensuring efficient use of resources and enhancing the overall patient journey. This can empower healthcare organizations to make informed decisions and provide better care outcomes.20,21,22
In recent years, there has been a significant focus on machine learning (ML) research in the context of AMI. This research primarily revolves around predicting patient mortality, patient readmission, and the occurrence of arrhythmia following an AMI. ML models have shown promising results in these areas, outperforming traditional statistical models and demonstrating their potential to improve risk assessment and patient outcomes in AMI cases.18,23,24,25
In recent years, machine learning (ML) research in AMI has primarily focused on predicting patient mortality, readmission, and the occurrence of arrhythmia. These ML models have demonstrated superior predictive capabilities compared to traditional statistical models, and their performance has been observed across various settings and populations, including Europe, the United States, and Asia, with a particular emphasis on predicting one-year or 30-day survival after AMI.19,23,24,26
The researchers aim to develop a predictive model for mortality in patients with AMI upon hospital admission in this study. They investigate the impact of incorporating cardiac test results, physiological data, and administrative data using machine learning techniques. The goal is to assess the predictive capability of these additional variables in improving mortality prediction for AMI patients. In the context of forecasting in-hospital mortality, this passage outlines three distinct methodologies. The initial approach, referred to as experiment 1, solely considers variables accessible at the time of admission. In experiment 2, we delve into the influence of supplementary data from laboratory results, comorbidity information, and the performance of surgical interventions, all of which can be gathered throughout the patient's hospitalization. Experiment 3, on the other hand, examines the integration of more precise pathology-related factors, including body mass index, symptomatology, the onset time of heart rate, ACS and the extent of injury across different segments. These approaches aim to enhance the accuracy of mortality prediction models by incorporating various factors and data collected at different stages of the patient's hospitalization.
Figure 1 showcases the comprehensive methodology employed in this study, encompassing a series of pivotal steps that lead to accurate predictions:

This section presents the outcomes of our study, focusing on the performance of three distinct machine learning models Decision Tree (DT), Support Vector Machine (SVM) and k-nearest Neighbors (KNN)—in the classification of a specific medical condition. We assessed these models using various evaluation metrics, including accuracy, the area under the ROC curve (AUC), confusion matrices, and classification reports.
Support Vector Machine (SVM) Model
The SVM model exhibited the highest level of accuracy among the three models, achieving an accuracy of approximately 87.66%. It demonstrated a robust ability to discriminate between the negative and positive classes, as evidenced by an AUC score of 0.796. In terms of precision, the SVM model showed a high precision of 0.92 for the negative class (0.0), indicating that it accurately predicted negative outcomes in the majority of cases. However, its precision for the positive class (1.0) was lower at 0.49, implying a higher rate of false positives for positive outcomes. The model demonstrated moderate recall for both classes, with higher recall for the negative class (0.94) compared to the positive class (0.43). The F1 scores also reflected the trade-off between precision and recall, with an F1 score of 0.93 for the negative class and 0.45 for the positive class.









In this section, we will examine and analyze the outcomes derived from three distinct machine learning models: SVM, DT, and KNN. These models were evaluated on their performance in classifying a specific medical condition, with a focus on metrics such as accuracy, the area under the ROC curve (AUC), the confusion matrix, and the classification report.
Support Vector Machine (SVM) Model: The SVM model demonstrated the highest accuracy among the three models, achieving an accuracy of approximately 87.66%. The confusion matrix demonstrates that the model accurately classified 321 instances as the negative class (0.0) and 20 instances as the positive class (1.0). However, it misclassified 21 instances from the negative class and 27 instances from the positive class.
The precision-recall trade-off is evident in the classification report. The precision for the negative class (0.0) is relatively high at 0.92, indicating that when the model predicts a negative outcome, it is accurate 92% of the time. However, the precision for the positive class (1.0) is lower at 0.49, suggesting that the model is less accurate in predicting positive outcomes.
The recall for both classes is moderate, with a higher recall for the negative class (0.94) compared to the positive class (0.43). This indicates that the model is better at identifying true negative cases but less effective at capturing true positive cases.
The F1-score, which combines precision and recall, is 0.93 for the negative class and 0.45 for the positive class, reflecting the trade-off between the two classes.
The AUC score of 0.796 suggests that the SVM model performs reasonably well in distinguishing between the two classes. Overall, the SVM model exhibits a relatively strong discriminatory ability.
Decision Tree (DT) Model: The Decision Tree model achieved an accuracy of approximately 83.55%, which is slightly lower than the SVM model. In the confusion matrix, it is evident that the model correctly classified 307 instances belonging to the negative class and 18 instances in the positive class. However, it made misclassifications by assigning 35 instances to the negative class and 29 instances to the positive class erroneously.
In the classification report, the precision for the negative class (0.0) is high at 0.91, indicating a low false-positive rate. However, the precision for the positive class (1.0) is relatively low at 0.34, suggesting that the model has a higher rate of false positives for positive outcomes.
The recall for the negative class stands at 0.90, signifying that the model effectively captures a substantial proportion of true negative cases. Conversely, the recall for the positive class is 0.38, suggesting a reduced capability to correctly identify true positive cases.
The F1 scores for both classes are moderate, with a higher score for the negative class (0.91) compared to the positive class (0.36).
The AUC score of 0.640 suggests that the Decision Tree model's discriminatory performance is lower than that of the SVM model.
k-Nearest Neighbors (KNN) Model: The KNN model achieved an accuracy of approximately 86.12%, falling between the SVM and Decision Tree models. The confusion matrix indicates that it correctly classified 335 instances of the negative class but failed to correctly classify any instances of the positive class, resulting in a precision of 0.00 for the positive class.
The recall for the negative class is high at 0.98, indicating a strong ability to capture true negative cases. However, the recall for the positive class is 0.00, indicating that the model does not identify any true positive cases.
The F1-score for the negative class is 0.93, showcasing the model's proficiency in accurately classifying true negatives. In contrast, the F1-score for the positive class is 0.00, suggesting a complete inability to classify true positives.
In summary, the KNN model demonstrates high accuracy in identifying the negative class but performs poorly in identifying the positive class, resulting in a low overall AUC score.
Overall Comparison: In conclusion, the SVM model outperforms the Decision Tree and KNN models in terms of accuracy, AUC, and overall classification performance. The SVM model exhibits a good balance between precision and recall for both classes, making it a suitable choice for this classification task. However, further optimization and fine-tuning of these models may be necessary to improve their performance, particularly in identifying positive cases. Additionally, it is essential to consider the clinical implications of model performance in the context of the specific medical condition being studied and the potential consequences of false positives and false negatives.
In this study, we conducted a comprehensive analysis of three machine learning models Support Vector Machine (SVM), Decision Tree (DT), and k-nearest Neighbors (KNN)—to assess their efficacy in classifying a specific medical condition. Our evaluation considered various performance metrics, including accuracy, area under the ROC curve (AUC), precision, recall, and F1-score, to provide a holistic understanding of their capabilities.
Among the models evaluated, the Support Vector Machine (SVM) model emerged as the most promising candidate. It demonstrated the highest accuracy of approximately 87.66% and exhibited a robust ability to discriminate between negative and positive cases, as evidenced by its AUC score of 0.796. While the model excelled in accurately predicting negative outcomes (0.0) with a high precision of 0.

An Official Publication of
Islamabad Medical & Dental College
Volume 13 Issue 1
Muhammad Idrees Khan
Email:
dr.idreeskhan707@gmail.com
Cite this article. Hussain C, Khan MI, Ullah N, Ullah A, Shah R, Khan A. Investing Machine Learning Models in Acute Myocardial Infarction to Predict Mortality. J Islamabad Med Dental Coll. 2024; 13(1): 101-109. DOI: https://doi.org/10.35787/jimdc.v13i1.1133