# Explainable Machine Learning Model for Chronic Kidney Disease Prediction
## 5 Discussion  
CKD is a progressive condition that often goes undetected until advanced stages, making early diagnosis crucial for effective intervention. The analysis and diagnosis of CKD are being enhanced by applying ML techniques. ML models can sift through complex datasets in search of insights and patterns that would be impossible to uncover with more conventional forms of research. The research presented in this paper focuses on the development of an explainable ML model for the prediction of CKD. Our study aims to address key challenges in ML-based medical diagnosis, including dataset balancing, handling missing data, feature selection, and model transparency. We employed the CKD dataset from the UCI ML Repository, renowned for its substantial presence of missing values. This problem was addressed by taking a comprehensive approach to missing data by using KNN imputation for numerical values and mode imputation for categorical values. Min-max scaling was used to normalize the feature values during data scaling. This approach improved the performance of the model. There are 24 predictive features in the dataset. Albumin, specific gravity, blood glucose random, sodium, potassium, hemoglobin, packed cell volume, red blood cell, hypertension, and diabetes  
Figure 10: LIME explanation for a patient predicted to be normal, with blue highlighting features contributing to a normal prediction and orange indicating features that are less relevant to CKD. Figure 9: LIME explanation for a patient predicted to have CKD, with orange highlighting features supporting CKD and blue representing features for a normal prediction. mellitus were among the twelve most important features that were chosen using the SelectKBest technique with mutual information score. These selected features, significant both statistically and clinically for CKD, This selection procedure preserves our model's robustness and generalizability. Our proposed MLP model comprises an output layer, two hidden layers, and an input layer. The first hidden layer consists of 59 neurons, and the second hidden layer has 94 neurons. The model uses the ReLU activation function. To prevent overfitting, we apply an L2 penalty with a value of 0.005. The learning rate is set to 0.01, and the model is trained for 100 iterations. We add a momentum of 0.3 to help accelerate gradient vectors towards faster convergences and use a random state of 42. The model was optimized using the Adam solver. To thoroughly evaluate the model's performance, the dataset was divided into 25% for testing and 75% for training. Several measures were used to assess our proposed model, such as F1-score, recall, accuracy, and precision. By comparing our model to other popular ML models, we found that it performs better than Bernoulli NB, Gaussian NB, logistic regression, DTs, RF, ridge, and SGD classifiers. In addition, we compared our model to other models in the literature that utilize the same dataset. Table 5 shows that our model outperforms the prior studies regarding accuracy and overall performance, demonstrating our superiority. The main problem with ML models is that they are not transparent. Even though ML models are very accurate, doctors and patients still don't always trust them, which is a major issue in the healthcare industry. These models have limited practical application in healthcare due to the lack of openness surrounding their prediction processes, such as disease diagnosis. Lack of trust occurs when healthcare providers are unable to comprehend or justify the reasoning behind a machine learning model's diagnosis. Because of this, they have not been widely used in practice, especially in the medical sector. To combat this, XAI techniques can make decision-making processes more open and clear, which benefits patients and doctors alike. More effective and moral AI healthcare applications result from such openness.