# Explainable Machine Learning Model for Chronic Kidney Disease Prediction
## 3 Methodology
### Model Training  
One kind of feedforward neural network that excels at handling non-linearly separable input is the Multi-layer Perceptron (MLP). Figure 5 shows an MLP model with two hidden layers. In each layer, there are neurons, and neurons in adjacent layers are fully connected to each other. Each connection has an associated weight, determining the strength of the connection. These weights are learned during the training process [49; 50]. Mathematically, the operation of a neuron can be described as follows:  
\[z=\sum_{i=1}^{n}w_{i}x_{i}+b \tag{3}\]  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature** & **Name** & **Description** \\ \hline sg & Specific gravity & Total concentration of all chemical particles in the urine \\ al & Albumin & Level of albumin in blood (0, 1, 2, 3, 4, 5) \\ bgr & Blood glucose random & Level of glucose blood at a random time (mgs/dL) \\ bu & Blood urea & Level of urea nitrogen in blood (mgs/dL) \\ sc & Serum creatinine & Level of creatinine in blood (mgs/dL) \\ sod & Sodium & Level of sodium in the blood (mEq/L) \\ pot & Potassium & Level of potassium in the blood (mEq/L) \\ hemo & Hemoglobin & Level of hemoglobin (Oxygen-transporting red protein) in blood (gms) \\ pcv & Packed cell volume & Proportion of blood volume occupied by cells \\ rc & Red blood cell count & Number of red blood cells (millions/cmm) \\ htn & Hypertension & Persistently raised arterial blood pressure (yes, no) \\ dm & Diabetes mellitus & Inadequate control of blood levels of glucose (yes, no) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comprehensive details of selected features for predictive modeling.  
where \(z\) is the weighted sum of inputs, \(w_{i}\) are the weights, \(x_{i}\) are the input features, and \(b\) is the bias term. Every neuron in the hidden layers and the output layer utilizes an activation function \(f\) on its weighted input sum:  
\[a=f(z) \tag{4}\]  
MLPs are trained using the backpropagation algorithm, which computes gradients of a loss function \(\mathcal{L}\) with respect to the model's parameters and updates the parameters iteratively to minimize the loss [51]. The weight update rule can be expressed as:  
\[w_{ij}\gets w_{ij}-\eta\frac{\partial\mathcal{L}}{\partial w_{ij}} \tag{5}\]  
where \(w_{ij}\) is the weight between neuron \(i\) and neuron \(j\), \(\eta\) is the learning rate, and \(\frac{\partial\mathcal{L}}{\partial w_{ij}}\) is the gradient of the loss function with respect to the weight. This training typically uses optimization algorithms, allowing the MLP to learn complex patterns and perform tasks effectively.  
In this study, we propose an MLP model for the prediction of CKD. The values of the hyperparameters utilized to construct the MLP model are presented in Table 2. The model consists of an output layer, two hidden layers, and an input layer. The input layer incorporates 12 features associated with CKD. The initial hidden layer comprises 59 neurons, the subsequent hidden layer contains 94 neurons, and the output layer is responsible for classifying CKD. The model employs the rectified linear unit (ReLU) activation function, which is defined as follows:  
\[\text{ReLU}(\xi)=\max(0,\xi)\]  
To prevent overfitting, we apply an L2 penalty (alpha) 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. For the purpose of minimizing the loss function, the Adam optimizer is utilized.  
Figure 4: Correlation heatmap illustrating the linear relationships between different features relevant to CKD.