Skip to Content
DiagnosticsDiagnostics
  • Article
  • Open Access

26 June 2026

41 Pages

Predicting Chronic Kidney Disease from Biomarkers: An Explainable Machine Learning Approach

,
and
1
Department of Medical Laboratory Sciences, The University of Jordan, Queen Rania St, Amman 11942, Jordan
2
Department of Networks and Cybersecurity, Faculty of Information Technology, Al-Ahliyya Amman University, Amman 19328, Jordan
3
Department of Basic Medical Sciences, Faculty of Medicine, Al-Balqa Applied University, Al-Salt 19117, Jordan
*
Author to whom correspondence should be addressed.

Abstract

Background/Objectives: Chronic kidney disease (CKD) remains underdiagnosed until advanced stages, motivating reliable, clinically deployable screening models that pair high discrimination with an explicit operating threshold and transparent explanations. Methods: In this study, we propose a CKD detection framework that integrates structured preprocessing, class imbalance handling, stratified 10-fold cross-validation with out-of-fold (OOF) prediction, and clinically oriented threshold selection via the Youden index, followed by explainability using SHAP and LIME. Experiments were conducted on two datasets. Across a broad panel of ten machine learning models, gradient boosting methods consistently dominated. Results: LightGBM achieved the best overall clinical composite performance on both datasets. On Dataset 1, LightGBM delivered near-ceiling OOF discrimination (ROC-AUC = 99.98, PR-AUC = 99.98) and an excellent clinically balanced performance at the best Youden threshold (0.41), reaching sensitivity = 99.20, specificity = 99.60, accuracy = 99.40, F1 = 99.40, and MCC = 98.80, with robust cross-validation stability (CV AUC = 99.99 ± 0.04; CV sensitivity = 99.10 ± 1.81; CV specificity = 99.46 ± 1.42; CV MCC = 98.59 ± 2.19), strong calibration (Brier = 0.006), and fast training (0.078 ± 0.019 s/fold). On Dataset 2, LightGBM maintained high generalization (ROC-AUC = 99.72, PR-AUC = 99.64) and clinically deployable balance at the best Youden threshold (0.35), achieving sensitivity = 98.10, specificity = 98.03, accuracy = 98.06, F1 = 98.06, and MCC = 96.13, with consistent fold-wise performance (CV AUC = 99.69 ± 0.25; CV sensitivity = 97.25 ± 1.25; CV specificity = 98.11 ± 1.02; CV MCC = 95.37 ± 1.56), acceptable calibration (Brier = 0.0173), and practical training time (0.742 ± 0.144 s/fold). Conclusions: Finally, SHAP and LIME explanations confirmed that model decisions align with clinically meaningful renal function and symptom/biomarker patterns at both population and patient levels, supporting safer translation of the proposed framework into CKD screening and decision-support workflows.

1. Introduction

Chronic kidney disease (CKD) is characterized by a permanent decline in glomerular filtration rate (GFR < 60 mL/min/1.73 m2 for ≥3 months) or signs of structural or functional damage in the renal structures [1,2]. Some of the top etiologies include diabetes, hypertension, and glomerulonephritis, all of which contribute to the significant burden of CKD in the world, high healthcare expenditures, and elevated morbidity and mortality risk [3,4]. Timely outcomes and early identification of the main risk factors are thus vital in maximizing the management of CKD and the outcomes of patients. Nonetheless, traditional clinical evaluation and laboratory analysis might not necessarily provide adequate, constant or personalized forecasting, especially in cases where biomarker patterns are not complete or in cases where numerous clinical variables interact in a nonlinear manner. As a result, there is an increasing need to develop computational methods that have the capability of incorporating common clinical biomarkers to aid with strong prediction and clinically significant risk stratification [5,6,7,8].
CKD is a major world health issue that affects more than 700 million people, which is about 10 percent of the global population [9]. Epidemiological studies also reveal that a high percentage of CKD patients are found in the low- and middle-income nations, where the healthcare services are usually limited in resources and screening and specialist services are not easily available. In clinical terms, CKD is classified into five stages depending on the severity of the disease, where stages 1–2 represent the early stage of the disease, stages 3–4 reflect moderate–severe impairment, and stage 5 is kidney failure [10]. The diagnosis and staging are based on the laboratory analysis of urinary abnormalities (excretion of proteins) and blood-based biochemical indicators of kidney activity, allowing classification of minimal kidney damage and severe renal failure [10]. Despite these well-developed clinical tools, practical risk stratification can be difficult to achieve due to the lack of reduction in the entire demographic–biochemical–clinical space that can affect the presence and progression of disease and due to the lack of important measures (such as proteinuria) or their inadequate reporting in clinical practice [11].
Artificial intelligence (AI) has become a revolutionary technology that has widespread use in a wide range of fields, such as medicine, environmental science, or transportation [12,13,14,15]. In the field of biomedicine, AI and machine learning (ML) find more applications in personalized diagnosis, risk prediction, and disease management since models can learn more complex patterns based on clinical and laboratory data [16,17,18,19]. Medical prediction is one of the tasks that machine learning approaches are most appropriate for since they can combine several variables at the same time, model nonlinear associations, and generate personalized probability instead of discrete judgment [16]. ML can be used to increase the detection performance in the context of CKD where diagnostic and prognostic decision-making is significantly dependent on biochemical and hematological markers, which can be supplemented by multi-biomarker signatures that cannot be readily identified using univariate analysis and simple rule-based reasoning [16,17]. This leads to the increased exploration of ML-based decision-support systems to aid clinicians in detecting CKD earlier and more reliably [20,21,22], particularly when clinical biomarkers gathered routinely are used.
Many ML models, despite their predictive potential, are incomprehensible, and can be viewed as black boxes, making it more challenging to promote clinical trust, acceptance, and usefulness as a model applied within the laboratory in making specific decisions [23,24,25]. Interpretability is also necessary, not only to justify individual predictions but also to ensure that model behavior is relevant to clinically meaningful biomarkers (e.g., the relationship between serum creatinine and estimated GFR and CKD status. Explainable artificial intelligence (XAI) is a leading-edge methodological framework that overcomes the weaknesses of the black-box type of predictive models by making a model output transparent and understandable. XAI can also help clinicians to critically assess the plausibility of predictions, understand the biomarkers that drive model results, and understand more intimately how predictive conclusions are made by discovering human-understandable insights into the underlying decision-making process. Such interpretability fosters trust in clinical practice, targeted and informed decision-making, and the responsible implementation of artificial intelligence in medical practice [23,24]. Shapley additive explanations (SHAP) and local interpretable model-agnostic explanations (LIME) are among the most popular XAI methods [26] that offer similar consistency in their global and local attributes based on cooperative game theory and provide instance-level explanations, respectively, making them model-agnostic and easy to interpret [23,27]. Such approaches can enhance the clinical believability of ML systems by connecting predictions to patterns of familiar biomarkers and substantiate explanation-oriented validation in clinical practices.
Guided by these requirements, the present study proposes and evaluates a falsifiable machine learning system for binary CKD prediction using clinical biomarker data, with performance assessed across two independent public datasets. The framework evaluates a large variety of ML classifiers on a standardized protocol, such as Logistic Regression (LR), Naive Bayes (NB), Decision Tree (DT), k-Nearest Neighbors (KNN), Support Vector Machine (SVM), Multi-Layer Perceptron (MLP), AdaBoost, Gradient Boosting, XGBoost, and LightGBM. We use stratified 10-fold cross-validation using out-of-fold (OOF) predictions to rigorously and clinically meaningfully assess our models to provide an accurate estimation of performance and be able to compare the performance of our models effectively. We further identify an operating threshold based on Youden’s J statistic that offers a clinically interpretable sensitivity and specificity balance and reports threshold-dependent statistics like recall (sensitivity), specificity, accuracy, F1-score, and Matthews correlation coefficient (MCC). Lastly, we combine SHAP with LIME to provide a system of complementary explainability: SHAP emphasizes the importance and directionality of biomarkers on the cohort wide, whereas LIME explains cases in individual sub-plots. Notably, considering the workflow on two datasets allows us to look at the performance strength and consistency of patterns of explanation under different feature sets and cohort features.
Unlike other studies that primarily focus on maximizing predictive performance, the present work emphasizes a clinically deployable framework that combines rigorous validation, threshold-aware decision-making, cross-dataset evaluation, and multi-level explainability to improve the transparency and reliability of CKD prediction.
The present work provides the following key findings:
  • End-to-end explainable framework, clinically oriented to predict binary CKD with routinely measured clinical biomarkers, which is intended to facilitate end-to-end screening and decision-support deployment as opposed to accuracy-only evaluation.
  • Intensive comparative evaluation of ten ML classifiers (LR, NB, DT, KNN, SVM, MLP, AdaBoost, Gradient Boosting, XGBoost, and LightGBM) through an identical preprocessing and evaluation procedure to achieve reproducibility and fair comparison.
  • Stratified 10-fold cross-validation that uses out-of-fold predictions and explicitly identifies clinically meaningful operating thresholds using the Youden J statistic, allowing the reporting of sensitivity specificity tradeoffs, Matthews correlation coefficient (MCC), and probability calibration (Brier score) instead of simply using arbitrary default cutoffs.
  • Dual-level explainability integration: Our second approach to explainability is dual-level explainability integration, combining SHAP and LIME to give not only global biomarker-level explainability but also explanatory narratives of individual patients, which make it easier to achieve transparency, auditability and clinical plausibility of model predictions.
  • The framework was tested on two samples of heterogeneous public CKD data, showing robust predictive accuracy and consistent patterns of explanation, which enhances generalizability and translational reliability.
The remainder of this paper is structured in the following way: Section 2 will conduct a literature review of related work on predicting CKD with the use of ML and XAI. Section 3 shows the methodology and talks about the suggested CKD framework. The experimental setting is described in Section 4. Section 5 describes the results and clinical implications of the same. Lastly, Section 6 is the conclusion and the future research directions.

3. Materials and Methods

In this section, the methodological pipeline that was employed in developing and assessing the proposed explainable machine learning framework to predict binary CKD based on clinical biomarkers is described. Initially, this section introduces the two publicly available datasets used for CKD prediction. The subsequent subsection outlines the preprocessing pipeline applied to enhance data integrity, handle missing values, standardize variables, and maintain consistency across models. The assessed machine learning classifiers and experimental setup are then described in detail. Model performance is evaluated using stratified 10-fold cross-validation, while out-of-fold (OOF) predictions are generated to provide robust and unbiased estimates of predictive performance. Furthermore, Youden’s J statistic is employed for threshold optimization, allowing the identification and reporting of clinically relevant operating points and their variability across validation folds. Finally, the explainability component of the framework is presented, whereby SHAP and LIME are used to provide complementary interpretations of model predictions at both the global and patient-specific levels. While SHAP identifies the overall importance of clinical biomarkers across the dataset, LIME explains the factors influencing individual predictions. Collectively, these components form a unified workflow that combines robust predictive modeling with interpretable, biomarker-driven insights, thereby enhancing clinical relevance and supporting informed decision-making. Figure 1 demonstrates a general flowchart of framework of the proposed methodology.
Figure 1. Flowchart of the proposed framework.

3.1. Datasets

In this study, two publicly available CKD-related datasets were utilized to evaluate the proposed framework and to examine its robustness across different feature sets and cohort characteristics.

3.1.1. Dataset 1

The first dataset used in this research was obtained from the UCI Machine Learning Repository [38]. It contains 400 instances described by 24 features and one class (demographic, clinical, and laboratory attributes). Each sample includes 24 features variables, 11 numerical and 13 nominal and categorical, and a binary target label indicating CKD or non-CKD. Before any balancing procedures, the dataset comprised 400 samples with 24 features, and the class distribution was 250 (class = CKD) and 150 (class = non-CKD). Table 2 shows the dataset list of features.
Table 2. Dataset 1 list of features.

3.1.2. Dataset 2

The second dataset was obtained from a publicly available Kaggle source [39] and contains comprehensive health records for 1659 patients related to chronic kidney disease (CKD). It includes a broad set of attributes covering demographics, lifestyle factors, medical history, clinical measurements, medication usage, symptoms, quality-of-life indicators, environmental exposures, and health behaviors, with each record uniquely indexed by a Patient ID (and a confidential field indicating the responsible doctor). Before any balancing procedures, the dataset comprised 1659 samples with 51 predictors, and the class distribution was 1524 (class = 1) and 135 (class = 0). Table 3 shows the dataset list of features.
Table 3. Dataset 2 list of features.

3.2. Dataset Preprocessing

To have resilient and repeatable experimentation, we applied a formal preprocessing pipeline comprising two specialized modules, medical data cleaner and medical preprocessor, which are used to perform fold-safe transformations and fold-safe artifact processing, respectively, to avoid data leakage cross-validation. Before the models’ training, both datasets were checked for missing values, inconsistent encodings, and data quality problems. For Dataset 1, the missing values were mostly replaced with the placeholder “?” which was then transformed to the standard missing value (NaN). Overall, there were 1012 missing values in Dataset 1, which is about 10.12% of all cells of the dataset. The highest missingness rates were observed in red blood cells (rbc: 38.00%), red blood cell count (rbcc: 32.75%), white blood cell count (wbcc: 26.50%), potassium (pot: 22.00%), sodium (sod: 21.75%), packed cell volume (pcv: 17.75%), pus cell (pc: 16.25%), hemoglobin (hemo: 13.00%), sugar (su: 12.25%), specific gravity (sg: 11.75%), albumin (al: 11.50%), and blood glucose random (bgr: 11.00%). Blood urea, serum creatinine, blood pressure, age and some binary clinical parameters had lower missingness. The second dataset (Dataset 2) did not have any missing data but was run through the same quality-control pipeline to ensure uniformity of the datasets.
Information leakage was addressed by using a loop for CV, within which the missing value imputation and feature transformations were performed. Numerical variables were imputed using KNN imputation, and categorical variables were imputed using the most frequent category in the training data for each training fold. After imputation, numerical variables were scaled according to the standard scaling method while categorical variables were encoded with the ordinal encoding method and unknown category handling. The learned parameters for imputation, scaling and encoding were then applied to the validation fold. This way, no information was used in the validation data during preprocessing, which gave reliable out-of-fold predictions and more trustworthy model evaluation. The pipeline had five consecutive steps such as exploration data analysis, cleaning, transformation, stratified splitting, and mitigation of class imbalance.

3.2.1. Data Exploration

Prior to model training, exploratory checks were performed to characterize data quality and identify potential issues affecting downstream learning. Feature-level missingness was quantified for each variable j by computing the missing count mj and missing rate rj as in Equation (1):
m j = ∑ i = 1 N I ( x i j = N a N ) , r j = m j N ,
where N is the number of samples and I ⋅ is the indicator function. The ranked missingness summary and visualization were saved for reporting.
In addition, numeric features were screened for extreme values using z-scores as in Equation (2):
z i j = x i j − μ j σ j ,
and potential outliers were flagged when ∣ z i j ∣   >   τ (default τ = 3 ); these outlier statistics were recorded for transparency rather than being forcibly removed in the provided implementation.

3.2.2. Data Cleaning

Cleaning operations were applied to standardize labels, handle missing value tokens, and harmonize categorical entries. The binary target label was normalized and mapped into { 0 , 1 } using a deterministic mapping f ( ⋅ ) , as in Equation (3):
y i = f ( y i raw ) = 1 , y i raw ∈ [ ckd , yes ] 0 , y i raw ∈ [ notckd , no ]
and the pipeline verifies that exactly two unique classes exist. Common missing-value placeholders (e.g., “?”, “NA”, “N/A”, “null”, empty strings) were replaced by NaN using Equation (4).
x i j ← N a N , x i j ∈ Ω x i j , otherwise
where Ω denotes the set of missing tokens.
Finally, feature names were normalized as a consistent scheme to ensure stable references across the pipeline.

3.2.3. Data Transformation

Transformations were performed in a type of aware manner after automatically identifying numeric and categorical feature subsets as in Equation (5):
N = j : feature   j   is   numeric , C = [ 1 , … , p ] ∖ N
Low-cardinality features (≤10 unique values) were optionally coerced to be numeric when feasible. Within each training fold, numeric variables were imputed (KNN-based in the preprocessor) and categorical variables were imputed using the most frequent category. A standard KNN-imputation formulation can be expressed as in Equation (6):
x ^ i j = ∑ n ∈ N K ( i ) w i n   x n j ∑ n ∈ N K ( i ) w i n , w i n = 1 d ( x i , x n ) + ϵ ,
where N K ( i ) is the set of KNNs and d ( x i , x n ) is a distance function. Numeric features were standardized using training-fold statistics as in Equation (7):
x i j scaled = x i j − μ j , tr σ j , tr ,
and categorical features were encoded using an ordinal encoding map ψ j ⋅ with unknown categories mapped to a reserved code during validation as in Equation (8):
x i j enc = ψ j ( x i j ) , x i j ∉ V j ⇒ x i j enc = − 1 .

3.2.4. Data Splitting

Model evaluation followed a stratified cross-validation design to preserve the original class proportions in each fold. Specifically, the dataset D was partitioned into K = 10 stratified folds { D t } t = 1 K such that in Equation (9):
∣ [ i ∈ D t : y i = 1 ] ∣ ∣ D t ∣ ≈ ∣ [ i ∈ D : y i = 1 ] ∣ ∣ D ∣ , ∀ t .
Critically, preprocessing was performed in a leakage-free manner by fitting the preprocessor only on the training subset of each fold and then transforming both training and validation partitions using the same learned parameters as in Equation (10):
θ t = F i t X tr t , X tr t ′ = T r a n s f o r m X tr t ; θ t , X va t ′ = T r a n s f o r m X va t ; θ t .

3.2.5. Handle Imbalanced Data

To mitigate class imbalance, the pipeline optionally applies SMOTE-based oversampling. Because SMOTE requires fully numeric and non-missing inputs, the code first performs a temporary NaN-aware filling step: numeric features are filled by the median and categorical features by the mode (with safe fallbacks), then categorical values are label-encoded to integers prior to resampling. SMOTE generates synthetic minority samples by interpolating between a minority sample x and one of its k-nearest minority neighbors x nn as in Equation (11)
x new = x + λ ( x nn − x ) , λ ∼ U ( 0 , 1 ) ,
with k adaptively adjusted based on the minority class size; if SMOTE fails, the pipeline falls back to random oversampling. After resampling, categorical features are inversely transformed back to their original labels when possible and data types are restored.

3.3. Machine Learning Models

To fairly and robustly assess the ability of the ML classifiers to detect CKD, a diverse set of classifiers were chosen across learning paradigms that are often applied in structured clinical prediction problems [40]. Logistic Regression and Naïve Bayes were chosen as simple, interpretable statistical baseline classifiers and Decision Tree, KNN, and SVM as tree-based [41], distance-based, and kernel-based classifiers. The incorporation of MLP was used as a measure to evaluate the potential of neural modeling to capture nonlinear interactions between the various biomarkers of CKD. Furthermore, ensemble boosting models (AdaBoost, Gradient Boosting, XGBoost, and LightGBM) were considered [42], as they have been found to be very suitable for tabular biomedical data and can model complex relationships among demographic, clinical, and laboratory variables effectively. These algorithms are compared within the same preprocessing, validation, threshold-selection and explainability framework, allowing the study to avoid any dependence on a certain model architecture and fair assessment of the predictive performance, stability and clinical interpretability. The goal was not to present a new model architecture but to determine the “best” one that is reliable and explainable in a clinically oriented evaluation setting in the context of binary prediction of CKD.

3.4. Selection of the Top ML Model for CKD Detection and XAI Explanations

After benchmarking the ten candidate classifiers, the top model was selected based on a clinically oriented, cross-validated out-of-fold (OOF) evaluation rather than a single split, to ensure an unbiased estimate of real-world performance. Let p ^ i denote the OOF-predicted probability of CKD for sample i. Using these OOF probabilities, an operating threshold τ ∗ was determined by maximizing Youden’s J statistics, which provides a balanced tradeoff between sensitivity and specificity as in Equation (12):
J ( τ ) = S e n s i t i v i t y ( τ ) + S p e c i f i c i t y ( τ ) − 1 , τ ∗ = a r g m a x τ ∈ [ 0 , 1 ] J ( τ )
Sensitivity and specificity at threshold τ are computed from the confusion matrix terms T P T N F P F N as:
S e n s i t i v i t y τ = T P τ T P τ + F N τ , S p e c i f i c i t y ( τ ) = T N ( τ ) T N ( τ ) + F P ( τ )
The predicted class label is then obtained as in Equation (13):
y ^ i = 1 , p ^ i ≥ τ ∗ , 0 , p ^ i < τ ∗ .
The top model was selected by prioritizing discrimination and clinical utility using OOF metrics, including ROC-AUC, PR-AUC, and Brier score, while also reporting threshold-dependent performance at τ ∗ namely accuracy, F1-score, MCC, sensitivity, and specificity. Accuracy and F1-score are defined as:
A c c u r a c y = T P + T N T P + T N + F P + F N , F 1 = 2 T P 2 T P + F P + F N
and the Matthews correlation coefficient (MCC) as in Equation (14):
M C C = T P ⋅ T N − F P ⋅ F N T P + F P ) ( T P + F N ) ( T N + F P ) ( T N + F N
To assess probability calibration, the Brier score was computed from the OOF probabilities in Equation (15):
B r i e r = 1 N ∑ i = 1 N p ^ i y i 2
Following model selection, explainability was incorporated to ensure that predictive decisions are clinically interpretable and biomarker-consistent. Two complementary XAI methods were applied: SHAP for global and local feature attribution and LIME for instance-level [43], model-agnostic explanations. For SHAP, the prediction for a sample x is decomposed into additive feature contributions in Equation (16):
f ( x ) = ϕ 0 + ∑ j = 1 p ϕ j
where ϕ 0 is the expected model output (baseline) and ϕ j _j quantifies the marginal contribution of feature j to the prediction. For LIME, an interpretable surrogate model g(⋅) (typically sparse linear) fits locally around x by minimizing in Equation (17):
a r g   m i n g ∈ G ( f , g , π x ) + Ω ( g )
where f is the original model, π x weights perturbed samples by proximity to x, L measures fidelity between f and g, and Ω(g) penalizes complexity to promote interpretability. Together, SHAP and LIME provide complementary evidence by identifying both consistent global biomarkers influencing CKD detection and patient-specific drivers of individual predictions, supporting clinical plausibility and trust in the selected model.
In summary, the proposed evaluation protocol is a combination of stratified 10-fold cross-validation followed by out-of-fold probability aggregation to generate objective estimations of performance and a clinically based operating point by choosing the decision threshold that maximizes Youden’s J statistic. It is a design allowing uniform reporting of both discrimination and calibration (ROC-AUC, PR-AUC, and Brier score) as well as threshold-dependent clinical measures (sensitivity, specificity, accuracy, F1-score, and MCC), and it also reports on the computational feasibility using fold-wise runtime statistics. Continuing this strict and reproducible protocol, the following section shows the experimental setting, implementation setting, configuration options, parameter options, and the experimental practical configuration, which was employed in implementing all experiments on the two datasets.

4. Experimental Setting

All of the experiments were conducted in Python 3.13 on a workstation with an Intel core i7 (3.2 GHz) processor, 16 GB RAM, and Windows 11 (64-bit). The Scikit-learn library was used to execute the implementations of the classical ML models, and LightGBM and XGBoost were used to execute the implementations of advanced ensemble and gradient boosting classifiers other libraries are in favor of. NumPy(2.1.3), Pandas (2.2.3), Matplotlib (3.10.0), and Seaborn (0.13.2) were used as data handling, analysis and visualization. To validate the evaluated models against one another, all ML classifiers were assessed under identical stratified 10-fold cross-validation splits and preprocessing conditions. This paired evaluation design ensured that each model was trained and tested on the same fold partitions, enabling direct comparison across algorithms. In addition to reporting discrimination and threshold-based metrics, fold-wise results were compared statistically to examine whether observed differences between models were consistent across validation folds. Multiple-comparison correction was applied when comparing several classifiers to reduce the risk of false-positive significance claims. Table 4 and Table 5 display the experimental parameter settings and hyperparameter settings of the classifiers, respectively.
Table 4. Experimental parameter settings.
Table 5. Hyperparameter settings of the classifiers.
Since the data used to evaluate the predictive performance of the models are of cross-sectional form, each data point was assumed to be an independent record at the level of the individual. There was no follow-up at any time point of the same patient because the dataset did not include longitudinal studies. Hence, all predictions were made from single-time point measures. Consequently, a stratified 10-fold cross-validation was carried out at the patient/sample level, and any non-predictive identifiers, when present, were excluded from the feature matrix prior to model training. Additionally, every preprocessing step was learned only on the training part of each fold, then later used on the matching validation partition. Thus, the whole point was to reduce the chance of information leakage, as much as possible. To have a fair comparison, all baseline and advanced models were evaluated under identical experimental conditions, including the same preprocessing pipeline, stratified 10-fold cross-validation partitions, random seed, imbalance-handling procedure, threshold-selection strategy, and performance metrics.

5. Results and Discussion

The proposed CKD detection framework was systematically tested within the preprocessing pipeline outlined and a stratified 10-fold validation scenario using a wide range of ML classifiers, namely LightGBM, XGBoost, Gradient Boosting, AdaBoost, Support Vector machine (SVM), k-Nearest Neighbors (KNN), Multi-layer perceptron (MLP), Logistic Regression (LR), Decision Tree (dt) and Naive Bayes (NB). In order to define the model generalizability in a thorough manner, two datasets have been chosen for experiment purposes. Therefore, the Results and Discussion Section will be split into two subsections, based on results obtained from different datasets. Some models’ results were near the ceiling of prediction performance; they should be interpreted according to the properties of the datasets that were evaluated. The several highly informative clinical biomarkers, such as serum creatinine, glomerular filtration rate (GFR), albuminuria and related laboratory measurements, are strongly associated with chronic kidney disease (CKD) and have a good discriminatory ability between CKD and non-CKD cases. Model assessment was performed using 10-fold cross-validation with out-of-fold (OOF) predictions to avoid overfitting within the data. Moreover, preprocessing and class-balancing techniques were performed only during the training folds, avoiding any information leakage. The results were also found to be consistent in two independent datasets with different feature compositions and cohort characteristics, indicating that the observed performance was based on the true ability to distinguish between the two biomarker types and not memorization.
This study adopted Youden’s J statistic to determine the optimal operating threshold because it provides an objective balance between sensitivity and specificity. However, threshold selection is inherently application-dependent, and alternative approaches such as fixed probability thresholds, F1-score optimization, precision–recall-based thresholding, cost-sensitive decision rules, or decision-curve analysis may be preferred in settings where minimizing false negatives or false positives carries different clinical consequences.

5.1. Dataset 1

In this subsection, we report and analyze the experimental results obtained on Dataset 1 to investigate the efficacy and clinical applicability of the proposed CKD detection pipeline. Summary of the performance is done with the help of both threshold-independent discrimination and reference to the clinically oriented outcomes which are threshold-based, and as a result the best Youden threshold is considered to maintain a balance between sensitivity and specificity. Figure 2 shows a confusion matrix of each classifier at this operating point which would give a clear picture of true positives, true negatives, false positives, and false negatives in CKD and non-CKD classification. Taken together, these findings explain the relative advantages and restrictions of the considered models and assist in determining the most consistent strategy to be used in this dataset.
Figure 2. Confusion matrix of Dataset 1.
Table 6 shows the performance comparison of each of the assessed ML models on Dataset 1 under the 10-fold CV/OOF protocol. The operating point which is clinically oriented is defined as the OOF best Youden threshold, and the results of the CV are presented in terms of the meaning with a standard deviation per fold. Lower training time is associated with the fact that the Brier score is better calibrated and yields more efficient computation. In general, the findings indicate that the gradient boosting family obtains the best results as LightGBM leads the list in combining almost-ceiling discrimination (ROC/AUC/PR-AUC) with the most balanced sensitivity and specificity tradeoff at the Youden threshold followed by XGBoost and Gradient Boosting. Even though classical baselines, including Decision Tree and Logistic Regression, are still competitive in terms of their MCC and/or sensitivity, the drop in their performance is significant in comparison to boosting methods. Incorporating these results, Figure 3 shows the OOF threshold sweep of the most ranked model (LightGBM) with sensitivity, specificity, and accuracy curves being plotted against candidate thresholds and the optimum Youden threshold being displayed to achieve a balanced tradeoff between sensitivity and specificity, as opposed to using a set default threshold (e.g., 0.50). This consideration is especially important in CKD screening, where the choice of decision threshold directly influences the false-negative to false-positive ratio at deployment. Together, Table 6 and Figure 2 establish that LightGBM achieves the best balance among screening effectiveness, error control, and strong agreement, rendering it a good candidate for the explainability analysis of Dataset 1.
Table 6. Results obtained from Dataset 1.
Figure 3. OOF threshold sweep for the top-ranked model (LightGBM).
A comparison of the OOF ROC curves of all classifiers on Dataset 1 is shown in Figure 4. The ROC curve shows the tradeoff between the sensitivity (true-positive rate) and the false-positive rate over all possible thresholds. The figure shows that the gradient boosting models specifically LightGBM, XGBoost, Gradient Boosting and AdaBoost are close to perfect discrimination. clustered around the top-left corner and the highest values in the AUC, which means that separability is excellent among CKD and non-CKD samples. Conversely, the traditional classification tools like SVM, KNN, and MLP have lower AUC and a less steep increase at low false-positive rates, which indicates weaker discrimination with severe screening restrictions.
Figure 4. OOF ROC curves of all classifiers.
Figure 5 reports the combined OOF precision–recall (PR) curves, which are particularly informative in clinical screening because they emphasize performance on the positive class (CKD) by relating precision (positive predictive value) to recall (sensitivity). The PR results are consistent with the ROC analysis: the top boosting models maintain very high precision across a broad recall range, yielding the highest average precision (AP). By comparison, models such as SVM, KNN, and MLP exhibit a more noticeable precision decline as recall approaches 1.0, implying a higher false-positive burden when attempting to maximize sensitivity. Overall, Figure 4 and Figure 5 confirm that LightGBM and other boosting methods provide the most robust threshold independent discrimination for CKD detection on Dataset 1.
Figure 5. OOF precision–recall (PR) curves for all classifiers.
Figure 6 presents the global SHAP feature importance. As shown, LightGBM’s decision processes follow a clinically coherent pattern, primarily drawing from kidney-related and cardiovascular metabolic indicators. Among these, albumin (al) and sugar (su) emerge as the top contributors, both of which are key urine markers. Some abnormalities which are routinely checked during kidney disease screening and staging procedures are highlighted. These include serum creatinine (sc), blood glucose level (bgr), and age, which represent the overall metabolic impact on the body as well as its renal filtering capability. Significantly, the importance of variables such as appetite (appet) and anemia (ane), which commonly occur due to decreased renal functioning and critical illnesses, has been emphasized in this model along with some other risk factors including blood pressure (bp), diabetes mellitus (dm), and coronary artery disease (cad). Taken together, the relative importance of these features demonstrates that the important results obtained through this model are not mere statistical outcomes but clinically relevant.
Figure 6. SHAP feature importance: LightGBM.
The SHAP beeswarm plot of LightGBM is presented in Figure 7. It represents an additional example of the influence of the features’ value on prediction changes between two cohorts, i.e., low versus high biomarker value. A patient is represented by a point, and the horizontal dispersion is used to measure the extent to which that feature shifts the model output towards the CKD class (positive SHAP) versus non-CKD (negative SHAP) by the label encoding that occurs in the pipeline. One important clinical observation is that a biomarker acting in a variable manner in different patients may be the same biomarker. Whether it is due to the range of its values or relating to other variables precisely is a reality that clinicians must deal with in practice (e.g., borderline lab values of low-risk patients vs. that same value in high-risk, multimorbidity patients). Since the presence of albumin (al) and sugar (su) occurs so often, the results of the urine tests cannot be seen as mere binary triggers. They are key influencers that establish the certainty of the model. By determining the classification of chronic kidney disease, the model gets to the very core of clinical decision-making.
Figure 7. SHAP beeswarm—LightGBM.
The dependence plot of al, appet, and su in Figure 8 shows that the LightGBM model does not learn linear relationships but instead learns a threshold like nonlinear relationships. Then there is a simple increase and decrease in risk. In the case of al, the regime is evident in the plot shift at which definite ranges of albumin values generate significantly greater impacts on SHAP, and the coloring emphasizes interaction by age implying that albumin-related signals can be increased within certain age groups in agreement with clinical intuition that suggests older patients have a narrower physiological margin and increased base level vulnerability. In the case of appet, the model shows a step-like shift of negative to positive SHAP contributions endorsing a clinically interpretable pattern: appetite-related status may serve as a practical syndrome-level indicator which consolidates nutrition effects of inflammation and uremia into a quantifiable signal. Considering su (sugar), the clusters are discrete owing to the categorical nature of this variable. There are significant differences in the SHAP value during the transitions between categories, indicating that the hypothesis on the ability of urine sugars to significantly change the probability of CKD is valid. Such a phenomenon is more visible against the backdrop of the urine albumin pattern.
Figure 8. Dependence plot for al, appet, and su.
Figure 9 shows the waterfall plots. The Waterfall Instance 2 and Instance 3 on the right show how the model’s predictions can be translated into case-based clinical narratives. Example 2 (high risk): In this scenario, the predicted risk is enhanced by a prominent cluster of abnormalities, such as albumin (al), sugar (su), and appetite (appet), backed up by blood glucose (bgr) and serum creatinine (sc), with further reinforcement from comorbidity features and other clinical context indicators (e.g., blood pressure (bp), physical examination (pe), and coronary artery disease (cad)). This reflects the holistic thinking of the clinician. CKD risk is not determined by a singular value in the lab, but rather it is the confluence of trends in urine results, renal function measurements, metabolic markers, and systemic manifestations. On the contrary, in the case of low risk, Instance 3 demonstrates high negative contributions. Using the same key features (notably al and su) the combination of these factors tends to cause the prediction to shift toward non-CKD even when each factor on its own has a small negative effect of this type. It is clinically significant as it demonstrates why the model is not overreactive to a single abnormal sign: it balances the consideration of whether the overall profile of biomarkers is consistent with CKD physiology internally or not.
Figure 9. Waterfall explanations—LightGBM.
Overall, these SHAP views show that LightGBM is not only highly accurate on Dataset 1, but also clinically interpretable at both the population and individual levels: it prioritizes urine and renal-function markers, captures nonlinear “risk regime” behavior, and produces patient-specific explanations that resemble real diagnostic synthesis, supporting safer translation of the model into screening or decision-support workflows.
To complement the global SHAP findings, local interpretable model-agnostic explanation (LIME) was used to provide case-level clinical narratives for LightGBM, illustrating why a specific patient was classified as CKD or No-CKD. Figure 10 shows LIME Case CKD and Figure 11 shows LIME Case No-CKD; the model’s predicted class probability is shown on the left, while the central bars quantify how the most influential features push the prediction toward CKD (right) or No-CKD (left), with the corresponding patient-specific feature values listed on the right. This local perspective is clinically valuable because it mirrors real practice: clinicians interpret CKD risk by integrating a small set of decisive abnormalities (urinalysis findings, filtration markers, metabolic indicators, and clinical signs), rather than relying on a single variable.
Figure 10. LIME Case CKD.
Figure 11. LIME Case No CKD.
In the CKD-positive example, the model predicts a very high probability of CKD (approximately 1.00) and LIME traces this prediction to a convergent clinical pattern that was largely driven by urinalysis results and results in renal function. The most powerful motivators to CKD are urine albumin (al) and urine sugar (su) with the help of specific gravity (sg) and serum creatinine (sc)—a product that is clinically aligned with kidney damage and impaired filtration physiology. Further input of blood pressure (bp) as well as the presence of systemic and clinical responses (e.g., pedal edema (pe)) also supports the CKD interpretation, and it is not a secret that CKD is directly related with hypertension and volume overload manifestations. Critically, the explanation does not act like a strict rule (e.g., high creatinine = CKD); rather, it demonstrates that LightGBM believes most in CKD in cases when several abnormalities relevant to kidney co-exist, which can also be explained by nephrology logic and minimize the risk of overreaction to an anomalous or noisy measurement.
In the No-CKD scenario, the model gives a very confident No-CKD probability (approximately 1.00), and in LIME, the opposite scenario is displayed, where the same clinically meaningful markers have the opposite effect, and the overall effect is that the prediction is pushed out of CKD. In this case, the local decision is dominated by the lower-risk patterns in urinalysis (notably, al and su leading to No-CKD) and the more reassuring context of renal function (e.g., sc leading to No-CKD in this case) but different factors such as age and metabolic context (e.g., bgr) modify the local decision somewhat, but in minor ways. According to the clinical deployment perspective, this constitutes precisely the behavior that screening support would wish. The model is capable of being very decisive when the overall constellation of biomarkers points to no kidney disease, including the presence of any single demographic or comorbidity marker, and places an emphasis on overall physiological integrity over individual feature triggering.
Overall, the LIME descriptions show that the suggested framework can develop clinically interpretable local decisions: (i) CKD predictions are motivated by a combined signal of urinalysis abnormalities and renal filtration markers as well as supported by clinical correlates (e.g., blood pressure/edema), and (ii) No-CKD predictions are justified when these most significant biomarkers support the indication of low risk. This enhances clinical trust by demonstrating that high performance of the model is obtained by using medically plausible decision logic that can ultimately be audited at the patient level and used to describe why a patient was flagged (or not flagged) during CKD screening.

5.2. Dataset 2

In this subsection, the outcomes of Dataset 2 will be described. Dataset 2 is larger and richer in features compared to Dataset 1 and will give a complementary analysis of the suggested framework. The analysis is concerned with the behavior of the tested classifiers on this more clinical profile as indicated by overall discrimination, operation point performance at the OOF best Youden threshold and the resulting compromise between CKD case capture and false-alarm control. Figure 12 displays the confusion matrix of each classifier operating at the chosen operating point, providing a deployment-relevant intuitive understanding of the results of the classification between CKD and non-CKD within this cohort.
Figure 12. Confusion matrix of Dataset 2.
The results obtained from Dataset 2 are shown in Table 7, which indicates that gradient boosting ensemble superiority is not cohort-dependent. In Dataset 2, LightGBM once again takes the first position with almost a ceiling of discrimination and a small range of sensitivity–specificity ratio at the optimal Youden threshold. The hierarchy of performance which is found in Dataset 1 is maintained; XGBoost and Gradient Boosting makes an apparent second tier, and classical baselines agree less and are less stable in clinical balance. It is worth noting that Dataset 2 further increases the difference between boosting algorithms and traditional classifiers, highlighting the tree-based ensemble scalability and resilience in more heterogeneous data conditions. Notably, the LightGBM OOF threshold sweep (Figure 13) has a larger plateau of equally high sensitivity and specificity around the optimal threshold (0.35) in comparison with Dataset 1. This suggests that it is more stable at the operating point, i.e., minor changes in threshold will not lead to clinically significant changes in the false-negative or false-positive rate. Concerning a screening point of view, this stability increases the trust in deployment since any reliable CKD detection should be able to withstand a small amount of calibration drift without causing harm to the patient.
Table 7. Results obtained from Dataset 2.
Figure 13. OOF threshold sweep for the top-ranked model (LightGBM).
In general, the fact that the cross-dataset ranking is consistent, along with better threshold stability on Dataset 2, supports the idea that LightGBM is not only a statistically most robust model, but also the solution with the most straightforward deployment. The combination of strength of discrimination, balance of errors, and strong operating in both cohorts is a great defense in its choice as the next step in the explainability and clinical interpretability analysis.
Figure 14 and Figure 15 give a threshold-free response that the performance ranking of Dataset 1 is maintained in Dataset 2 and responds to the behavior of the model in a larger, more heterogeneous cohort. LightGBM and XGBoost in the ROC domain (Figure 14) are near-ceiling and heavily concentrated on the upper-left part, which suggests that the outstanding separability observed in Dataset 1 applies well to Dataset 2, as opposed to being cohort-specific. Nevertheless, in contrast to Dataset 1 in which a few models were close to ideal ROC/PR behavior, the ROC curves of Dataset 2 are more spaced out between methods, especially between traditional learners (e.g., Naïve Bayes, KNN, and some linear baselines) and more complex methods, and with more feature variation in Dataset 2.
Figure 14. OOF ROC curves of all classifiers.
Figure 15. OOF precision–recall (PR) curves of all classifiers.
Cross-dataset contrast can also be emphasized by the precision–recall analysis as in Figure 15. Although the average precision of Dataset 1 was uniformly high in all of the models, Dataset 2 displays a more definite performance difference in precision–recall space: the boosting ensembles (LightGBM, XGBoost, and Gradient Boosting) continue to be very precise over a broad recall range, and the less powerful approaches more noticeably lose their precision as they move towards the sensitivity of a screening test. The change is clinically essential owing to the increased susceptibility of PR curves to class disproportion and false-positive load; hence, Dataset 2 is more exposed to the models that can maintain high positive predictive value and are responsible as much as possible for CKD case capture. The PR/ROC comparisons between the two datasets, combined, validate two findings: to begin with, the best boosting models are always robust across the cohorts; and finally, Dataset 2 is more effective to distinguish deployment-ready models with a greater emphasis on precision stability in the operating requirements on high recall, which further supports the argument that LightGBM is the most reliable screening-focused classifier in both tests.
The global SHAP with important features of Dataset 2 as shown in Figure 16 indicates that the two key predictors of LightGBM are serum creatinine and GFR, which dominate the predictors by a long way compared to the other variables. Such is the phenotype of CKD expected clinically: high creatinine indicates decreased clearance and low GFR directly codes for decreased capacity to filtrate. In addition to its renal activity, the model gives significant importance to gender, uremic symptom burden (itching and muscle cramps), hemodynamic/metabolic determinants (systolic blood pressure and fasting blood sugar) and BUN levels, family history of hypertension and smoking, which are clinically sound risk factors or symptoms of CKD progression.
Figure 16. SHAP feature importance of Dataset 2 using LightGBM.
The beeswarm plot of Dataset 2 as shown in Figure 17 explains the way these variables are driving the predictions towards CKD vs. non-CKD. The increasing values of serum creatinine always cause the SHAP values to move towards the CKD direction, and the increasing GFR moves the predictions towards non-CKD (and vice versa). Notably, the SHAP values of creatinine and GFR have broad distributions, and LightGBM does not operate under a strict rule but modifies the signal of the renal function to the situation of the patient, which is a critical feature of the screening of heterogeneous groups of individuals. An analogous clinically interpretable pattern is present in the case of supportive features: rising systolic BP, rising fasting glucose, rising BUN and rising symptom severity (itching, muscle cramps) tend to move the model to the CKD classification, consistent with established cardio-metabolic risk and uremic symptomatology behavior.
Figure 17. SHAP beeswarm—LightGBM.
The dependence plots (Figure 18, gender, GFR, and serum creatinine) indicate that the LightGBM model uses nonlinear relationships that are structured and physiologically plausible as opposed to making use of naive linear trends. In the case of serum creatinine, the dependence curve will show a strong monotonic increase in SHAP values with increases in creatinine. Strongly negative SHAP contributions (protective effect) are related to low creatinine values, and high values quickly revert the prediction to CKD. The almost-linear positive curve shows that creatinine is a prevailing biochemical severity parameter incorporated into the model. Notably, the color effect on the BMI is that the effect of the creatinine elevation could be modulated by the metabolic burden, indicating the established association existing between obesity, metabolic syndrome, and renal stress.
Figure 18. Dependence plot for gender, GFR, and serum creatinine.
In the case of GFR, an inverse nonlinear relationship has been noticed. An increasing GFR gives a strongly negative SHAP contribution (protective renal functioning), whereas a decreasing GFR gives a sharply positive SHAP impact. The steeper slope of the lower GFR area is reflective of the clinical fact that disproportionate risk accrual in renal failure is found at advanced stages. Biological coupling of the interaction of coloring with serum creatinine is confirmed by the fact that patients with low GFR and high creatinine have a higher signal of CKD risk. This two-way physiological similarity of the two biomarkers strengthens mechanism validity.
In the case of gender, the model does not consider sex as a nominal input category, but it gives a directional effect systematically. One of the gender categories always allows a positive shift of the SHAP values, which suggests high modeled risk, and the other makes a negative shift. The interplay with diet quality indicates that the environmental or behavioral modifiers affect the expression of gender-specific biological predisposition in the risk of CKD. This pattern should not be seen as the manifestation of bias, but epidemiological disparities in CKD progression, comorbidity burden and healthcare behavior. Generally, the dependence plots substantiate the fact that core nephrological principles are embedded in the LightGBM model: the increasing serum creatinine and decreasing GFR are nonlinear accelerators of the estimated CKD risk, but the risk increase is stronger with increasing clinically relevant thresholds. The pattern of interaction indicates that the model is based on multivariate mechanisms of renal stress as opposed to the effect of individual features. Datasets 2 has more profound physiology as compared to Dataset 1.
The waterfall descriptions shown in Figure 19 transform the decision process by LightGBM into case-based clinical scripts consistent with reasoning at the bedside in nephrologists. In an instance with a high likelihood of the event (Instance 4; left panel), a convergent risk signature dominated by high serum creatinine (largest positive prediction) along with urinary tract infection and itching together demonstrates a clinically plausible process of renal dysfunction with overall symptom burden. Notably, there is also multi-domain reinforcement in the model due to BUN, gender and alcohol consumption which means that the end decision is not elicited by an individual marker but is the result of the accumulation of risks across biochemical impairment, clinical symptoms and context. Interestingly, GFR will play the opposite role here and is an indication of partial physiological compensation or heterogeneity in the profile, but the cumulative effect evidence is strong enough to provide a high-risk assignment, an interpretation that is manifested in real-world practice where discordant signals can occur but do not invalidate an overall high-risk phenotype.
Figure 19. Waterfall explanations—LightGBM.
However, the converse scenario is the case of low risk (Instance 5; right panel), where the model shifts to non-CKD under a coherent protective profile, which is based predominantly on the lower serum creatinine, lower BUN, and more desirable GFR-related effect, and reinforced by other negative effects of systolic blood pressure, itching, gender, and diet quality. Clinically, this implies that LightGBM is very conservative with its decision-making approach when faced with conflicting data. Even though high BMI increases the probability of developing CKD, LightGBM does not overestimate this single risk factor since the other markers of the kidneys do not indicate kidney problems. This is clinically useful in the sense that it indicates evidence integration, which minimizes the possibility of using unnecessary alarms due to isolated abnormalities. Overall, the waterfall descriptions prove that the predictions of the model can be clinically synthesized: in Dataset 2, LightGBM gives more emphasis to biologically dominant renal biomarkers (serum creatinine, GFR, and BUN) and correctly incorporates symptoms and contextual modifiers, which can be characterized as individualized explanations that are similar to real diagnostic aggregation instead of black-box choices. In contrast to the interpretations for Dataset 1, which relied extensively on parameters related to urine as well as categorically coded variables, those for Dataset 2 are based on biochemical interpretations and stage-related analysis. As such, Dataset 2 is better suited for use as a screening or decision tool.
To supplement the global SHAP results of Dataset 2, LIME was implemented to produce clinical narratives of patients of the highest-ranked LightGBM model, explaining why one or another person is identified as CKD or Non-CKD. Figure 20 (CKD case) and Figure 21 (No-CKD case) illustrate the predicted class probability on the left, and the central contribution bars indicate how the most significant variables move the decision to CKD (right) or the No-CKD (left), and the patient-specific feature values are listed on the right. For CKD, the model is based on an informative pattern that includes features of renal dysfunction along with symptom and contextual features. This includes mainly serum creatinine, which is confirmed by GFR, BUN, and symptom/management features like itching, muscle cramps, and use of diuretics as well as contextual features like water quality, UTI, etc. The outcome produced by such an algorithm is therefore realistic considering what can be expected from such dysfunction. By contrast, in No-CKD the model is pulled unambiguously away from CKD by a more internally consistent protective pattern of the renal markers (serum creatinine and GFR) even with individual contextual risk factors (e.g., cholesterol, occupational exposure to chemicals, or family-history factors) having a small contribution. This local interpretability is critically important clinically since it captures the way real screening choices are determined, where a small combination of determinative abnormalities leads to case-by-case justification across all filtration markers, all metabolic profiles, all symptoms, all treatment cues and exposures, and thus is justifiable in case-by-case descriptions of all decisions available to CKD decision-support practices.
Figure 20. LIME Case CKD.
Figure 21. LIME Case No-CKD.
The proposed CKD detection framework has shown consistent and clinically relevant performance on both datasets. In addition, the results indicated that population-specific characteristics may influence the relative importance and diagnostic value of clinical biomarkers, stressing the need for context-aware interpretation of machine learning predictions in CKD screening and diagnosis. In Dataset 1, gradient boosting models—most notably LightGBM—demonstrated near-ceiling discriminatory performance with a highly stable Youden-optimized operating point. This configuration provided an effective balance between minimizing missed CKD cases and reducing false alarms. Furthermore, the explanatory features consistently converged on canonical nephrology cues, including urinalysis markers and renal-function surrogates such as albumin/glucose profiles and creatinine-associated physiology. Dataset 2 adds a more sophisticated feature space that resembles the real world, including symptoms, medications, behaviors, and exposures. Risk is signaled more directly in Dataset 2. The interpretability framework introduces a clinically robust dimension: serum creatinine and GFR remain the main anchors, but risk is also contextually shaped by symptom burden (e.g., pruritus, muscle cramps), treatment settings, and environmental or occupational indicators. This reflects the multifactorial interaction that clinicians consider when stratifying CKD remotely, beyond purely laboratory-based assessments. All of these findings are consistent: the framework is not merely accurate but threshold-sensitive and clinically interpretable even in heterogeneous data regimes, and can be deployed with a high level of calibration so that a decision threshold can be adjusted in a way that balances local screening priorities and explanations that are consistent with nephrology logic at both population and individual levels contributing to enhanced trust, auditability and real-world translation of CKD decision support.

6. Conclusions and Future Directions

In this study, we propose a clinically meaningful and interpretable machine learning framework for detection of chronic kidney disease (CKD). The proposed approach was rigorously evaluated on two heterogeneous public datasets using a stratified 10-fold cross-validation protocol with out-of-fold (OOF) predictions to ensure robust and unbiased performance estimation. The framework integrated predictive modeling and explainability techniques to offer robust diagnostic performance and transparent, biomarker-driven insights for clinical interpretation and decision-making. In both cohorts, gradient boosting models always provided the highest discrimination, as well as the most predictive threshold-based screening behavior, and LightGBM became the best-performing classifier, both in terms of strong ROC-AUC/PR-AUC performance and a clinically sensible operating point, identified using the Youden criterion. In addition to its accuracy, the framework was developed with clinical interpretability as a core objective. SHAP analyses were structured to yield both global and local explanations that align with nephrological reasoning—whereby renal-function markers such as serum creatinine and GFR are given a priori precedence and were presented in formats amenable to interpretation within clinical symptoms and lifestyle contexts, as demonstrated through LIME case narratives. All of these results suggest that the proposed pipeline could be used to facilitate feasible CKD screening and risk stratification, as it provides high levels of generalization across datasets, clear management of the sensitivity–specificity tradeoff during deployment, and explainable mechanisms, which would facilitate trust and clinical auditability. Future work will aim to strengthen external validity and ensure that the models are clinically prepared for deployment in real-world settings.
To determine the transportability of the framework across populations, measurement protocols, and prevalence changes, future work will first involve checking the framework on multi-center cohorts and prospectively collected data. Second, we will aim to generalize threshold choice to cost-sensitive and utility-based criteria explicitly modeling clinical harm (false-negative risk) and resource utilization (false-positive follow-up), and we will also include more detailed calibration studies to provide sound probability results. Third, to identify trends in CKD progression and enable early intervention, we will incorporate temporal and longitudinal modeling based on repeated laboratory values and comorbidity trajectories. Fourth, explainability layer will be extended to contain clinician-facing summaries and counterfactual suggestions to aid actionable decision-making, as well as fairness audits by demographic subgroups to limit possible prejudice. Lastly, to ensure that the outputs, thresholds, and explanations provided by the model align with the actual diagnostic and care processes, we will explore lightweight deployment and real-time implementation strategies into clinical workflows (e.g., EHR-based decision support), supported by usability studies with clinicians.
This study has a limitation. Although the results were encouraging in two independent public CKD datasets, they were not validated in external clinical data in hospitals or medical laboratories. The developed framework will be tested on multi-center clinical cohorts from different healthcare settings in the future to further evaluate its generalizability, robustness and clinical utility across patient populations and laboratory settings. Furthermore, prospective validation studies and integration into clinical decision-support systems will be discussed to help safe and reliable deployment in clinical nephrology practice. Another important direction for future research is the systematic evaluation of class imbalance management techniques. Even though SMOTE was used in the current framework to mitigate class imbalance while training, doing a more dedicated ablation that compares results with vs. without oversampling ended up being outside the scope here. Future work will investigate how different resampling approaches such as SMOTE, Borderline-SMOTE, ADASYN, and cost-sensitive learning shape predictive performance calibration, threshold stability and model interpretability across a variety of CKD cohorts.

Author Contributions

Conceptualization, A.A.-M. and E.Y.A.; methodology, O.A.; software, O.A.; validation, A.A.-M., and O.A.; formal analysis, E.Y.A.; investigation, A.A.-M.; resources, A.A.-M.; data curation, O.A.; writing—original draft preparation, A.A.-M.; writing—review and editing, E.Y.A.; visualization, O.A.; supervision, A.A.-M.; project administration, A.A.-M. and O.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The datasets supporting the findings of this study is publicly available through the following URL: Dataset 1: https://archive.ics.uci.edu/dataset/336/chronic+kidney+disease (accessed on 20 January 2026); Dataset 2: https://www.kaggle.com/datasets/rabieelkharoua/chronic-kidney-disease-dataset-analysis (accessed on 20 January 2026).

Acknowledgments

The authors thank all participants who contributed to this study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Levey, A.S.; Eckardt, K.U.; Tsukamoto, Y.; Levin, A.; Coresh, J.; Rossert, J.; Zeeuw, D.D.; Hostetter, T.H.; Lameire, N.; Eknoyan, G. Definition and classification of chronic kidney disease: A position statement from Kidney Disease: Improving Global Outcomes (KDIGO). Kidney Int. 2005, 67, 2089–2100. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. Kalantar-Zadeh, K.; Jafar, T.H.; Nitsch, D.; Neuen, B.L.; Perkovic, V. Chronic kidney disease. Lancet 2021, 398, 786–802. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  3. Hernandez, M.; Blancas, R.; Kiadaliri, A.; Lami, A.; Martin, A.; Arsenijevic, A.; Abdulhak, B.; Rivas, C.; Ao, T.; Defo, K.; et al. Global, regional, and national life expectancy, all-cause mortality, and cause-specific mortality for 249 causes of death, 1980–2015: A systematic analysis for the Global Burden of Disease Study 2015. Lancet 2016, 388, 10053. [Google Scholar]
  4. ElSayed, N.A.; Aleppo, G.; Aroda, V.R.; Bannuru, R.R.; Brown, F.M.; Bruemmer, D.; Collins, B.S.; Hilliard, M.E.; Isaacs, D.; Johnson, E.L.; et al. Chronic kidney disease and risk management: Standards of care in diabetes. Diabetes Care 2023, 46, S191. [Google Scholar] [PubMed]
  5. Segal, Z.; Kalifa, D.; Radinsky, K.; Ehrenberg, B.; Elad, G.; Maor, G.; Lewis, M.; Tibi, M.; Korn, L. Machine learning algorithm for early detection of end-stage renal disease. BMC Nephrol. 2020, 21, 518. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  6. Xiao, J.; Ding, R.; Xu, X.; Guan, H.; Feng, X.; Sun, T.; Zhu, S.; Ye, Z. Comparison and development of machine learning tools in the prediction of chronic kidney disease progression. J. Transl. Med. 2019, 17, 119. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  7. Makino, M.; Yoshimoto, R.; Ono, M.; Itoko, T.; Katsuki, T.; Koseki, A.; Kudo, M.; Haida, K.; Kuroda, J.; Yanagiya, R.; et al. Artificial intelligence predicts the progression of diabetic kidney disease using big data machine learning. Sci. Rep. 2019, 9, 11862. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Chowdhury, N.H.; Reaz, M.B.I.; Haque, F.; Ahmad, S.; Ali, S.H.M.; A Bakar, A.A.; Bhuiyan, M.A.S. Performance analysis of conventional machine learning algorithms for identification of chronic kidney disease in type 1 diabetes mellitus patients. Diagnostics 2021, 11, 2267. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  9. Reddy, S.; Roy, S.; Choy, K.W.; Sharma, S.; Dwyer, K.M.; Manapragada, C.; Miller, Z.; Cheon, J.; Nakisa, B. Predicting chronic kidney disease progression using small pathology datasets and explainable machine learning models. Comput. Methods Programs Biomed. Update 2024, 6, 100160. [Google Scholar] [CrossRef] [Scilit]
  10. Dharmarathne, G.; Bogahawaththa, M.; McAfee, M.; Rathnayake, U.; Meddage, D. On the diagnosis of chronic kidney disease using a machine learning-based interface with explainable artificial intelligence. Intell. Syst. Appl. 2024, 22, 200397. [Google Scholar] [CrossRef] [Scilit]
  11. Kovesdy, C.P. Epidemiology of chronic kidney disease: An update 2022. Kidney Int. Suppl. 2022, 12, 7–11. [Google Scholar] [CrossRef] [Scilit]
  12. Molinara, M.; Cancelliere, R.; Di Tinno, A.; Ferrigno, L.; Shuba, M.; Kuzhir, P.; Maffucci, A.; Micheli, L. A deep learning approach to organic pollutants classification using voltammetry. Sensors 2022, 22, 8032. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  13. Sayed, A.; Hemdan, E.E.-D. Conditional generative adversarial networks with optimized machine learning for fault detection of triplex pump in industrial digital twin. Processes 2024, 12, 2357. [Google Scholar] [CrossRef] [Scilit]
  14. Abu-Shareha, A.A.; Abualhaj, M.M.; Hussein, A.; Almomani, O.; Amer, A.; Achuthan, A.; Halin, A.A. A comparative study of the diabetes progression prediction techniques. Discov. Artif. Intell. 2025, 6, 74. [Google Scholar] [CrossRef] [Scilit]
  15. Jabali, E.; Almomani, O.; Qatawneh, L.; Badwan, S.; Almomani, Y.; Al-Soreeky, M.; Ibrahim, A.; Khalil, N. Deep Learning Based Computer-Aided Detection of Prostate Cancer Metastases in Bone Scintigraphy: An Experimental Analysis. J. Imaging 2026, 12, 121. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  16. Miller, Z.A.; Dwyer, K. Artificial intelligence to predict chronic kidney disease progression to kidney failure: A narrative review. Nephrology 2025, 30, e14424. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  17. Cancelliere, R.; Molinara, M.; Licheri, A.; Maffucci, A.; Micheli, L. Artificial intelligence-assisted electrochemical sensors for qualitative and semi-quantitative multiplexed analyses. Digit. Discov. 2025, 4, 338–342. [Google Scholar]
  18. Lei, N.; Zhang, X.; Wei, M.; Lao, B.; Xu, X.; Zhang, M.; Chen, H.; Xu, Y.; Xia, B.; Zhang, D.; et al. Machine learning algorithms’ accuracy in predicting kidney disease progression: A systematic review and meta-analysis. BMC Med. Inform. Decis. Mak. 2022, 22, 205. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  19. Tarek, R.; Elshenawy, A.; Madkour, M.A. Automated diagnosis of dental diseases using deep learning on radiographic images. SN Comput. Sci. 2025, 6, 751. [Google Scholar] [CrossRef] [Scilit]
  20. Khanom, F.; Mostafiz, R. Pd_ebm: An integrated boosting approach based on selective features for unveiling parkinson’s disease diagnosis with global and local explanations. Eng. Rep. 2025, 7, e13091. [Google Scholar]
  21. Owida, H.A.; Al-Nabulsi, J.; Al Hawamdeh, N.; Abuowaida, S.; Elsoud, E.A. Deep Learning-Based Kidney Disease Classification Using ResNet50: Enhancing Diagnostic Accuracy. In Proceedings of the 2024 Second Jordanian International Biomedical Engineering Conference (JIBEC), Amman, Jordan, 27–28 November 2024; IEEE: New York, NY, USA, 2024; pp. 126–129. [Google Scholar]
  22. Kausar, M.A.; Ghazal, T.M.; Al Batahari, M.; Nasar, M.; Al-Dmour, N.A.; Saeed, A.Q. Kidney Disease Prediction Using Machine Learning. In Proceedings of the 2025 3rd International Conference on Business Analytics for Technology and Security (ICBATS), Dubai, United Arab Emirates, 1–2 May 2025; IEEE: New York, NY, USA, 2025; pp. 1–8. [Google Scholar]
  23. Hu, C.; Tan, Q.; Zhang, Q.; Li, Y.; Wang, F.; Zou, X.; Peng, Z. Application of interpretable machine learning for early prediction of prognosis in acute kidney injury. Comput. Struct. Biotechnol. J. 2022, 20, 2861–2870. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Watson, D.S.; Krutzinna, J.; Bruce, I.N.; Griffiths, C.E.; McInnes, I.B.; Barnes, M.R.; Floridi, L. Clinical applications of machine learning algorithms: Beyond the black box. BMJ 2019, 364, 1886. [Google Scholar] [CrossRef] [Scilit]
  25. Azodi, C.B.; Shiu, S.-H. Opening the black box: Interpretable machine learning for geneticists. Trends Genet. 2020, 36, 442–455. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  26. Chaddad, A.; Peng, J.; Bouridane, A. Survey of explainable AI techniques in healthcare. Sensors 2023, 23, 634. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  27. Lundberg, S.M.; Erion, G.; Chen, H.; DeGrave, A.; Prutkin, J.M.; Nair, B.; Katz, R.; Himmelfarb, J.; Bansal, N.; Lee, S.I. From local explanations to global understanding with explainable AI for trees. Nat. Mach. Intell. 2020, 2, 56–67. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  28. Noor, A.A.; Manzoor, A.; Mazhar Qureshi, M.D.; Qureshi, M.A.; Rashwan, W. Unveiling explainable AI in healthcare: Current trends, challenges, and future directions. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2025, 15, e70018. [Google Scholar] [CrossRef] [Scilit]
  29. Rahman, A.; Kundu, D.; Debnath, T.; Rahman, M.; Das, U.K.; Miah, A.S.M.; Muhammad, G. From AI to the era of explainable AI in Healthcare 5.0: Current state and future outlook. Expert Syst. 2025, 42, e70060. [Google Scholar] [CrossRef] [Scilit]
  30. Shiddik, M.A.B. Explainable Artificial Intelligence in Healthcare: Current Landscape, Challenges, and Future Directions. Health Sci. Rep. 2026, 9, e72172. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  31. David, S.K.; Siddiqui, K. Comparison of different machine learning techniques to predict diabetic kidney disease. J. Healthc. Eng. 2022, 2022, 7378307. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  32. Arif, M.S.; Rehman, A.U.; Asif, D. Explainable machine learning model for chronic kidney disease prediction. Algorithms 2024, 17, 443. [Google Scholar] [CrossRef] [Scilit]
  33. Ghosh, S.K.; Khandoker, A.H. Investigation on explainable machine learning models to predict chronic kidney diseases. Sci. Rep. 2024, 14, 3687. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  34. Hegde, G.; Shenoy, P.D.; Canchi, A. A deep learning framework for chronic kidney disease stage classification. Healthc. Anal. 2025, 7, 100398. [Google Scholar] [CrossRef] [Scilit]
  35. Iftikhar, H.; Hashem, A.F.; Rodrigues, P.C. Clinical application of machine learning models for early-stage chronic kidney disease detection. Diagnostics 2025, 15, 2610. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  36. Kim, H.; Woo, H. Deep Learning-Based Death Prediction Model for Chronic Kidney Disease. Healthc. Inform. Res. 2025, 31, 396–404. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  37. Huang, J.; Li, L.; Chen, J. Bayesian optimization meets explainable AI: Enhanced chronic kidney disease risk assessment. Mathematics 2025, 13, 2726. [Google Scholar] [CrossRef] [Scilit]
  38. Rubini, P.S.L.; Eswaran, P. Chronic Kidney Disease; UCI Machine Learning Repository: Irvine, CA, USA, 2015. [Google Scholar] [CrossRef]
  39. Kharoua, R.E. Chronic Kidney Disease Dataset. Kaggle. Available online: https://www.kaggle.com/datasets/rabieelkharoua/chronic-kidney-disease-dataset-analysis (accessed on 22 June 2026).
  40. Gogoi, P.; Valan, J.A. Machine learning approaches for predicting and diagnosing chronic kidney disease: Current trends, challenges, solutions, and future directions. Int. Urol. Nephrol. 2025, 57, 1245–1268. [Google Scholar] [PubMed]
  41. Salloum, S.A.; Almomani, O.; Almomani, A.; Alomari, K.M.; Arya, V. Semantic-Enhanced Classification of DNA Sequences Using Machine Learning and Deep Learning Approaches. Int. J. Semant. Web Inf. Syst. (IJSWIS) 2026, 22, 1–28. [Google Scholar] [CrossRef] [Scilit]
  42. Hsu, C.-T.; Huang, C.-Y.; Chen, C.-H.; Deng, Y.-L.; Lin, S.-Y.; Wu, M.-J. Machine learning models to predict osteoporosis in patients with chronic kidney disease stage 3–5 and end-stage kidney disease. Sci. Rep. 2025, 15, 11391. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  43. Shambour, Q.; Al-Zyoud, M.; Almomani, O. Quantum-inspired hybrid metaheuristic feature selection with SHAP for optimized and explainable spam detection. Symmetry 2025, 17, 1716. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.