Ensemble and Explainable AI-Based Framework for Early Prediction of Heart Disease
Abstract
At present, heart disease is one of the major causes of death all over the world. Identification of cardiovascular risk at the initial stage will help improve the outcomes of the affected patients and provide adequate care, thereby lessening the economic burden on the community's health. This work aims to present an integrated and clear machine learning framework for active anticipation of cardiac conditions. The dataset that we use for training and performing validation is called Cleveland Heart Disease and is available from the UCI Machine Learning Repository. Systematically, the categorical attributes are transformed into numerical, normalized continuous attributes to obtain consistency, so that there are as many numerical, normalized continuous attributes as possible and maximum model performance. Several supervised learning algorithms were experimented with, including Logistic Regression, Decision Tree, SVM, Random Forest, and KNN. The predictionA soft-voting ensemble technique was used to provide stability of prediction and generality. This group of people will use Random Forest, Gradient Boosting, Extra Trees, and KNN classifiers to enhance the accuracy and reliability of decision- making in groups. The classification accuracy of the individual classifiers, SVM and KNN, was 87% and 86%, respectively, in the case of testing. The performance of the proposed soft-voting ensemble was better and succeeded in achieving an accuracy of 98% as well as good ROC-AUC and precision-recall values. The key clinical factors were identified as thalassemia status, ST slope, and type of chest pain through interpretability analysis with LIME. The ensemble classifiers showed more stability in prediction and generalization than the classifiers used alone. Explainable AI techniques enhanced the transparency of models, helping health care practitioners understand patient risk factors. A methodology was improved, disease-free patients were identified as high-risk, and an extra practical application was added to the ECG representation of risk. The proposed hybrid and explainable machine learning architecture demonstrates substantial predictive accuracy, robustness, and interpretability for the early detection of heart disease. The system functions as a dependable clinical decision-support tool and serves as a foundational element for prospective integration with extensive, privacy-preserving healthcare frameworks.