ObjectiveHypertension is a pressing medical dysfunction that increases the risks of many fatal diseases. Early detection of hypertension can be crucial to lead a healthy life. Machine learning (ML) can be useful for the early prediction of a patient's likelihood of having a blood pressure abnormality and preventing it. Explainable artificial intelligence (XAI) is a state-of-the-art ML toolset that helps us understand and explain the prediction of an ML model. This research aims to build an automatic blood pressure anomaly detection system with maximum accuracy using the fewest features and learn why a model arrived at a particular result using XAI. MethodsThis research utilized the "Blood Pressure Data for Disease Prediction" dataset from Kaggle. Data were collected from medical reports of random participants in 2019 based on the presence of blood pressure abnormality, chronic kidney disease, and adrenal and thyroid disorders. We have used several ML algorithms (extreme gradient boosting (XGBoost), random forest (RF), support vector machine (SVM), decision tree (DT), and Logistic regression (LR)) to predict blood pressure abnormality based on patient's data. Principal component analysis (PCA) and recursive feature elimination (RFE) algorithms are used as feature optimizers. The receiver operating characteristic (ROC) curve analysis and accuracy were the key outcome metrics. Through the experiment, we have also calculated various performance measurement techniques like precision, recall, specificity, F1 score, and kappa to pin down the model with the best performance. Moreover, we have implemented several XAI methods namely permutation feature importance (PFI), partial dependence plots (PDP), Shapley additive explanations (SHAP), and local interpretable model-agnostic explanations (LIME) for additional exploration of our best model. ResultsThe combination of RFE and XGBoost provides the most significant results. The results of the study show that the algorithm has an AUC of 0.95, indicating good discriminatory power in detecting abnormal BP. The accuracy, precision, recall, specificity, F1-score, and kappa gained are 91.50%, 88.64%, 92.65%, 92.27%, 90.83%, and 0.8 respectively. According to the results of the XAI experiment, the genetic pedigree coefficient and hemoglobin level in a patient contribute the most to blood pressure abnormality prediction. Adrenal and thyroid diseases, as well as chronic kidney illness, have an impact on the projections. Existing research backs up this conclusion. ConclusionWhile comparing to previous works on this dataset, the results of our research are superior and the use of XAI shed new light on our model's prediction. This study would provide new insight into blood pressure detection in the medical profession.