Unveiling the Gaps: Machine Learning Models for Unmeasured Ions
Abstract
1. Introduction
- To examine the independent associations of AGc, SIG, and BEGap with arterial pH in a large cohort of critically ill patients.
- To benchmark traditional, Stewart, and partitioned BE approaches using both multiple linear regression (MLR) and machine learning (ML) models under linear and non-linear modeling assumptions.
- To evaluate the robustness and temporal external generalizability of these analytical approaches using an independent validation cohort.
- To explore potential bedside clinical implications through representative clinical cases, illustrating how BEGap-based interpretation may complement conventional approaches.
2. Methods
2.1. Study Design and Population
- The internal development cohort consisted of 2274 patients admitted between January 2018 and December 2022, used for model training and internal validation.
- The external validation cohort comprised 1202 patients admitted between January 2023 and June 2025, used exclusively for external performance evaluation.
2.2. Missing Data Management
2.3. Model Development and Validation
(0.123 × pH − 0.631) × Albumin (g/L) + Pi (mmol/L) × (0.309 × pH − 0.469)]
2.3.1. Statistical Analysis
- Traditional approach (PaCO2, HCO3, AGc)
- Stewart’s approach (PaCO2, SIDa, ATOT, SIG)
- Partitioned base excess approach (PaCO2, BECl, BEAlb, BELac, BEGap)
2.3.2. Regression Models
2.3.3. Machine Learning Models
- Random Forest (RF)
- Extreme Gradient Boosting (XGBoost)
- Support Vector Regression (SVR, RBF kernel)
- Calibration-in-the-large (mean observed − predicted pH),
- Calibration slope and intercept,
- Brier-style mean squared error for continuous outcomes.
2.3.4. Feature Importance and Explainability
- Tree-based importance (TreeImp)—reduction in prediction error per variable in RF/XGBoost.
- SHAP values—game-theoretic contribution of each predictor.
- Permutation importance—change in prediction error after random shuffling (for SVR). A composite ranking was derived by averaging normalized TreeImp and SHAP scores.
2.3.5. Illustrative Clinical Cases
3. Results
3.1. Patient Characteristics
3.2. Multivariable Linear Regression Analysis
3.3. Machine Learning Performance
3.4. Internal Cross-Validation Performance
3.4.1. Calibration and Discrimination
3.4.2. Variable Importance
Random Forest (RF)
Extreme Gradient Boosting (XGB)
Support Vector Regression (SVR)
Feature Ablation Analysis
External Validation
Correlation and Agreement Analyses Between AGc, SIG, and BEGap
3.5. Analytical Comparison Across Illustrative Cases
4. Discussion
4.1. Findings and Comparison with Current Literature
4.2. Clinical Implications
4.3. Limitations
5. Conclusions
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Achanti, A.; Szerlip, H.M. Acid-Base Disorders in the Critically Ill Patient. Clin. J. Am. Soc. Nephrol. 2023, 18, 102–112. [Google Scholar] [CrossRef] [Scilit]
- Venkatesh, B.; Morgan, T.J. Unmeasured Anions: The Unknown Unknowns. Crit. Care 2008, 12, 113. [Google Scholar] [CrossRef] [Scilit]
- Forni, L.G.; McKinnon, W.; Hilton, P.J. Unmeasured Anions in Metabolic Acidosis: Unravelling the Mystery. Crit. Care 2006, 10, 220. [Google Scholar] [CrossRef] [Scilit]
- Berend, K.; De Vries, A.P.; Gans, R.O. Physiological Approach to Assessment of Acid–Base Disturbances. N. Engl. J. Med. 2014, 371, 1434–1445. [Google Scholar] [CrossRef] [Scilit]
- Story, D.A.; Poustie, S.; Bellomo, R. Estimating Unmeasured Anions in Critically Ill Patients: Anion-Gap, Base-Deficit, and Strong-Ion-Gap. Anaesthesia 2002, 57, 1109–1114. [Google Scholar] [CrossRef] [Scilit]
- Fidkowski, C.; Helstrom, J. Diagnosing Metabolic Acidosis in the Critically Ill: Bridging the Anion Gap, Stewart, and Base Excess Methods. Can. J. Anesth./J. Can. D’anesthésie 2009, 56, 247–256. [Google Scholar] [CrossRef] [Scilit]
- Kraut, J.A.; Madias, N.E. Serum Anion Gap: Its Uses and Limitations in Clinical Medicine. Clin. J. Am. Soc. Nephrol. 2007, 2, 162–174. [Google Scholar] [CrossRef] [Scilit]
- Hatherill, M.; Waggie, Z.; Purves, L.; Reynolds, L.; Argent, A. Correction of the Anion Gap for Albumin in Order to Detect Occult Tissue Anions in Shock. Arch. Dis. Child. 2002, 87, 526–529. [Google Scholar] [CrossRef] [Scilit]
- Chawla, L.S.; Shih, S.; Davison, D.; Junker, C.; Seneff, M.G. Anion Gap, Anion Gap Corrected for Albumin, Base Deficit and Unmeasured Anions in Critically Ill Patients: Implications on the Assessment of Metabolic Acidosis and the Diagnosis of Hyperlactatemia. BMC Emerg. Med. 2008, 8, 18. [Google Scholar] [CrossRef] [Scilit]
- Zampieri, F.G.; Park, M.; Ranzani, O.T.; Maciel, A.T.; de Souza, H.P.; Neto, L.M.d.C.; da Silva, F.P. Anion Gap Corrected for Albumin, Phosphate and Lactate Is a Good Predictor of Strong Ion Gap in Critically Ill Patients: A Nested Cohort Study. Rev. Bras. Ter. Intensiv. 2013, 25, 205–211. [Google Scholar] [CrossRef] [Scilit]
- Kellum, J.A.; Elbers, P.W. Stewart’s Textbook of Acid-Base; Lulu Press, Inc.: Morrisville, NC, USA, 2009. [Google Scholar]
- Ho, K.M.; Lan, N.S.H.; Williams, T.A.; Harahsheh, Y.; Chapman, A.R.; Dobb, G.J.; Magder, S. A Comparison of Prognostic Significance of Strong Ion Gap (Sig) with Other Acid-Base Markers in the Critically Ill: A Cohort Study. J. Intensive Care 2016, 4, 43. [Google Scholar] [CrossRef] [Scilit]
- Kellum, J.A.; Kramer, D.J.; Pinsky, M.R. Strong Ion Gap: A Methodology for Exploring Unexplained Anions. J. Crit. Care 1995, 10, 51–55. [Google Scholar] [CrossRef] [Scilit]
- Kellum, J.A. Closing the Gap on Unmeasured Anions. Crit. Care 2003, 7, 219. [Google Scholar] [CrossRef] [Scilit]
- Story, D.A. Acid–Base Analysis in the Operating Room: A Bedside Stewart Approach. Anesthesiology 2023, 139, 860–867. [Google Scholar] [CrossRef] [Scilit]
- Story, D.A. Stewart Acid-Base: A Simplified Bedside Approach. Anesth. Analg. 2016, 123, 511–515. [Google Scholar] [CrossRef] [Scilit]
- Morgan, T.J. Partitioning Standard Base Excess: A New Approach. J. Clin. Monit. Comput. 2011, 25, 349–352. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- O’DEll, E.; Tibby, S.M.; Durward, A.; Aspell, J.; A Murdoch, I. Validation of a Method to Partition the Base Deficit in Meningococcal Sepsis: A Retrospective Study. Crit. Care 2005, 9, R464. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Gao, P.; Min, J.; Zhong, L.; Shao, M. Association between Albumin Corrected Anion Gap and All-Cause Mortality in Critically Ill Patients with Acute Kidney Injury: A Retrospective Study Based on Mimic-Iv Database. Ren. Fail. 2023, 45, 2282708. [Google Scholar] [CrossRef] [Scilit]
- Cusack, R.; Rhodes, A.; Lochhead, P.; Jordan, B.; Perry, S.; Ball, J.; Grounds, R.; Bennett, E. The Strong Ion Gap Does Not Have Prognostic Value in Critically Ill Patients in a Mixed Medical/Surgical Adult Icu. Intensive Care Med. 2002, 28, 864–869. [Google Scholar] [CrossRef] [Scilit]
- Rocktaeschel, J.; Morimatsu, H.; Uchino, S.; Bellomo, R. Unmeasured Anions in Critically Ill Patients: Can They Predict Mortality? Crit. Care Med. 2003, 31, 2131–2136. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Agrafiotis, M.; Sileli, M.; Ampatzidou, F.; Keklikoglou, I.; Panousis, P. The Base Excess Gap Is Not a Valid Tool for the Quantification of Unmeasured Ions in Cardiac Surgical Patients: A Retrospective Observational Study. Eur. J. Anaesthesiol. 2013, 30, 678–684. [Google Scholar] [CrossRef] [Scilit]
- Gucyetmez, B.; Gucyetmez, K.; Sarikaya, Z.T.; Telci, L. Independent Variables of Ph: Ten Knights of the Hydrogen Ion Kingdom-Part I. A Prospective Observational Study. PLoS ONE 2024, 19, e0306756. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Sanagustín, M.; Osredkar, J. Blood Gas Analysis: Clinical Applications, Interpretation and Future Directions. Med. Int. 2025, 6, 7. [Google Scholar] [CrossRef] [Scilit]
- Eloranta, S.; Boman, M. Predictive Models for Clinical Decision Making: Deep Dives in Practical Machine Learning. J. Intern. Med. 2022, 292, 278–295. [Google Scholar] [CrossRef] [Scilit]
- Huyut, M.T.; Üstündağ, H. Prediction of Diagnosis and Prognosis of Covid-19 Disease by Blood Gas Parameters Using Decision Trees Machine Learning Model: A Retrospective Observational Study. Med. Gas Res. 2022, 12, 60–66. [Google Scholar] [CrossRef] [Scilit]
- Ozdemir, H.; Sasmaz, M.I.; Guven, R.; Avci, A. Interpretation of Acid–Base Metabolism on Arterial Blood Gas Samples via Machine Learning Algorithms. Ir. J. Med. Sci. (1971-) 2025, 194, 277–287. [Google Scholar] [CrossRef] [Scilit]
- Phetrittikun, R.; Suvirat, K.; Horsiritham, K.; Ingviya, T.; Chaichulee, S. Prediction of Acid-Base and Potassium Imbalances in Intensive Care Patients Using Machine Learning Techniques. Diagnostics 2023, 13, 1171. [Google Scholar] [CrossRef] [Scilit]
- Helleberg, J.; Sundelin, A.; Mårtensson, J.; Rooyackers, O.; Thobaben, R. Beyond Labels: Determining the True Type of Blood Gas Samples in Icu Patients through Supervised Machine Learning. BMC Med. Inform. Decis. Mak. 2025, 25, 275. [Google Scholar] [CrossRef] [Scilit]
- Mousavinejad, S.N.; Lachouri, R.; Bahadorzadeh, M.; Khatami, S.H. Artificial Intelligence for Arterial Blood Gas Interpretation. Clin. Chim. Acta 2025, 579, 120691. [Google Scholar] [CrossRef] [Scilit]
- Moons, K.G.; Damen, J.A.; Kaul, T.; Hooft, L.; Navarro, C.A.; Dhiman, P.; Beam, A.L.; Van Calster, B.; Celi, L.A.; Denaxas, S.; et al. Probast+Ai: An Updated Quality, Risk of Bias, and Applicability Assessment Tool for Prediction Models Using Regression or Artificial Intelligence Methods. BMJ 2025, 388, e082505. [Google Scholar] [CrossRef] [Scilit]
- Tontu, F.; Aşar, S.; Bilgin, B.Ö.; Yıldız, G.Ö.; Tontu, K.A.; Çukurova, Z. Stewart’s Approach for Acid-Base Disorders: Does the Strong Ion Difference and Effects Have an Impact on Intensive Care Unit Mortality? Turk. J. Intensive Care 2023, 21, 25–32. [Google Scholar] [CrossRef] [Scilit]
- Gucyetmez, B.; Tuzuner, F.; Atalan, H.K.; Sezerman, U.; Gucyetmez, K.; Telci, L. Base-Excess Chloride; the Best Approach to Evaluate the Effect of Chloride on the Acid-Base Status: A Retrospective Study. PLoS ONE 2021, 16, e0250274. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kaplan, L.J.; Kellum, J.A. Initial Ph, Base Deficit, Lactate, Anion Gap, Strong Ion Difference, and Strong Ion Gap Predict Outcome from Major Vascular Injury*. Crit. Care Med. 2004, 32, 1120–1124. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Dybała, M.; Bartkowska-Śniatkowska, A.; Pietrzkiewicz, K.; Wiernik, A.; Rosada-Kurasińska, J.; Piontek, T.; Oleksiak, A.; Czyrski, A. Machine Learning Techniques for the Analysis of the Influence of Blood Gasometry Parameters on Acid–Base Homeostasis in Pediatric Patients. Diagnostics 2025, 15, 3166. [Google Scholar] [CrossRef] [Scilit]
- Ma, X.; Li, J.; Zhou, Q.; Wang, J. Serum Lactate and the Mortality of Critically Ill Patients in the Emergency Department: A Retrospective Study. Exp. Ther. Med. 2023, 26, 371. [Google Scholar] [CrossRef] [Scilit]
- Xgboost: A Scalable Tree Boosting System. In Proceedings of the 22nd Acm Sigkdd International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016.
- dos Passos, M.G.; Blaya, L.B.; Boniatti, M.M. Comparison of a Modified Story Approach to Traditional Evaluation of Acid–Base Disturbances in Patients with Shock: A Cohort Study. J. Clin. Monit. Comput. 2022, 36, 817–822. [Google Scholar] [CrossRef] [Scilit]



| Parameters | 2018–2022 | 2023–2025 |
|---|---|---|
| n | 2274 | 1202 |
| Age, years | 68 (57–79) | 62 (48–72) |
| Male, n (%) | 1383 (61%) | 515 (42%) |
| BMI, (kg/m2) | 26.4 (23.8–29.8) | 26 (24–29) |
| APACHE II | 26 (22–31) | 24 (20–28) |
| SOFA score | 7 (5–10) | 7 (5–9) |
| Mortality, n (%) | 908 (40%) | 420 (35%) |
| pH | 7.37 (7.3–7.42) | 7.37 (7.3–7.42) |
| PaCO2 (mmHg) | 40.9 (35.0–47.7) | 39.6 (34.3–45.8) |
| HCO3− (mmol/L) | 22.9 (19.8–25.3) | 22.6 (19.8–24.7) |
| AGc (mmol/L) | 17.6 (15.2–21.0) | 18.4 (15.7–21.7) |
| Na (mmol/L) | 138 (135–141) | 138 (135–141) |
| K (mmol/L) | 4.09 (3.63–4.59) | 4.1 (3.8–4.6) |
| Ca (mmol/L) | 1.17 (1.11–1.23) | 1.15 (1.1–1.25) |
| Mg (mmol/L) | 0.80 (0.72–0.90) | 0.81 (0.74–0.92) |
| Cl (mmol/L) | 104 (100–107) | 103 (100–107) |
| Alb (g/L) | 31.2 (26–36.4) | 32.9 (28.1–38) |
| [Alb]− (mmol/L) | 8.5 (7–9.9) | 9 (7.7–10.4) |
| Lactate (mmol/L) | 1.80 (1.20–2.95) | 1.7 (1.2–3) |
| PO4 (mg/dL) | 3.8 (3.1–4.9) | 3.9 (3.1–5.1) |
| Pi (mmol/L) | 1.23 (1.00–1.58) | 1.26 (1.02–1.64) |
| [Pi]− (mmol/L) | 2.2 (1.8–2.8) | 2.29 (1.85–2.96) |
| SBE (mmol/L) | −1.60 (−5.30–1.40) | −2.1 (−5.4–0.5) |
| BECl (mmol/L) | −1.00 (−4.00–2.00) | 0 (−3–2) |
| BELac (mmol/L) | −0.80 (−1.95–−0.20) | −0.7 (−2.2–−0.2) |
| BEAlb (mmol/L) | 2.70 (1.41–4.00) | 2.27 (1–3.47) |
| BEGap (mmol/L) | −1.85 (−4.96–0.55) | −2.5 (−5.7–−0.1) |
| SIDa (mmol/L) | 37.7 (34.7–40.6) | 38.3 (35.8–41.3) |
| ATOT (mmol/L) | 10.9 (9.49–12.35) | 11.6 (10.23–12.95) |
| SIG (mmol/L) | 3.64 (1.42–6.35) | 4.46 (2.09–7.2) |
| Approach | Variable | Coefficient | 95% CI | p | P.I. |
|---|---|---|---|---|---|
| Traditional | Adjusted R2: 0.929; Durbin-Watson: 2.11; ANOVA: p < 0.001 | ||||
| HCO3 | 0.0176 | (0.0173, 0.0179) | <0.001 | 0.524 | |
| PaCO2 | −0.0057 | (−0.0058, −0.0056) | <0.001 | 0.436 | |
| AGc | −0.0014 | (−0.0017, −0.001) | <0.001 | 0.039 | |
| Stewart | Adjusted R2: 0.926; Durbin-Watson: 2.02; ANOVA: p < 0.001 | ||||
| PaCO2 | −0.0089 | (−0.009, −0.009) | <0.001 | 0.348 | |
| SIDa | 0.0186 | (0.018, 0.019) | <0.001 | 0.290 | |
| SIG | −0.0193 | (−0.020, −0.019) | <0.001 | 0.238 | |
| ATOT | −0.0197 | (−0.020, −0.019) | <0.001 | 0.124 | |
| Partitioned BE | Adjusted R2: 0.949; Durbin-Watson: 1.89; ANOVA: p < 0.001 | ||||
| PaCO2 | −0.0058 | (−0.006, −0.006) | <0.001 | 0.264 | |
| BEGap | 0.0153 | (0.015, 0.016) | <0.001 | 0.253 | |
| BECl | 0.0145 | (0.014, 0.015) | <0.001 | 0.250 | |
| BELac | 0.0157 | (0.015, 0.016) | <0.001 | 0.136 | |
| BEAlb | 0.0153 | (0.015, 0.016) | <0.001 | 0.097 | |
| Approach | Algorithm | Variable | TreeImp | SHAP | Combined |
|---|---|---|---|---|---|
| Traditional | RF | R2: 0.979; RMSE: 0.015; MAE: 0.009 | |||
| HCO3 | 0.632 | 0.066 | 0.349 | ||
| PaCO2 | 0.358 | 0.048 | 0.203 | ||
| AGc | 0.008 | 0.00075 | 0.004 | ||
| XGBoost | R2: 0.974; RMSE: 0.017; MAE: 0.01 | ||||
| HCO3 | 0.658 | 0.067 | 0.362 | ||
| PaCO2 | 0.334 | 0.049 | 0.191 | ||
| AGc | 0.007 | 0.002 | 0.004 | ||
| Stewart | RF | R2: 0.876; RMSE: 0.038; MAE: 0.023 | |||
| PaCO2 | 0.424 | 0.055 | 0.240 | ||
| SIDa | 0.313 | 0.050 | 0.182 | ||
| SIG | 0.201 | 0.035 | 0.119 | ||
| ATOT | 0.061 | 0.015 | 0.038 | ||
| XGBoost | R2: 0.967; RMSE: 0.019; MAE: 0.011 | ||||
| PaCO2 | 0.408 | 0.069 | 0.239 | ||
| SIDa | 0.320 | 0.065 | 0.193 | ||
| SIG | 0.192 | 0.050 | 0.121 | ||
| ATOT | 0.079 | 0.029 | 0.054 | ||
| Partitioned BE | RF | R2: 0.922; RMSE: 0.03; MAE: 0.019 | |||
| BEGap | 0.349 | 0.045 | 0.197 | ||
| PaCO2 | 0.308 | 0.044 | 0.177 | ||
| BECl | 0.189 | 0.038 | 0.114 | ||
| BELac | 0.117 | 0.019 | 0.06 | ||
| BEAlb | 0.034 | 0.009 | 0.021 | ||
| XGBoost | R2: 0.975; RMSE: 0.017; MAE: 0.011 | ||||
| BEGap | 0.308 | 0.049 | 0.179 | ||
| PaCO2 | 0.277 | 0.049 | 0.163 | ||
| BECl | 0.217 | 0.047 | 0.132 | ||
| BELac | 0.149 | 0.024 | 0.086 | ||
| BEAlb | 0.048 | 0.018 | 0.033 | ||
| Approach | Model | Full R2 | Ablated R2 | ΔR2 | Removed Variable |
|---|---|---|---|---|---|
| Traditional | RF | 0.966 | 0.966 | 0.000 | AGc |
| XGB | 0.972 | 0.964 | 0.008 | AGc | |
| Stewart | RF | 0.876 | 0.548 | 0.328 | SIG |
| XGB | 0.967 | 0.496 | 0.471 | SIG | |
| Partitioned BE | RF | 0.922 | 0.588 | 0.334 | BEGap |
| XGB | 0.975 | 0.536 | 0.439 | BEGap |
| Parameter | Case 1 | Case 2 | Case 3 |
|---|---|---|---|
| Clinical Context | 69M, urosepsis + AKI | 72M, COPD + abdominal sepsis | 32F, abdominal pain, DKA/AKI |
| pH | 7.32 | 7.37 | 7.45 |
| PaCO2 (mmHg) | 29.1 | 55 | 18 |
| HCO3− (mmol/L) | 16 | 31 | 18 |
| SBE (mmol/L) | −10.1 | +5.2 | −9 |
| Na+ (mmol/L) | 145 | 136 | 125 |
| K+ (mmol/L) | 2.3 | 3.3 | 2.4 |
| Cl− (mmol/L) | 121 | 92 | 86 |
| Ca2+ (mmol/L) | 1.43 | 1.2 | 1.1 |
| Mg2+ (mmol/L) | 0.93 | 0.91 | 0.94 |
| Pi (mmol/L) | 1.6 | 1.4 | 1.2 |
| Lactate (mmol/L) | 1 | 3.4 | 2.0 |
| Albumin (g/L) | 27 | 24 | 38 |
| AGc (mEq/L) | 14 | 20.8 | 24.4 |
| SIDa (mEq/L) | 27.7 | 46 | 41.4 |
| ATOT (mmol/L) | 10.1 | 13 | 13 |
| SIG (mEq/L) | +1.6 | +2 | +10.4 |
| BECl (mEq/L) | −11 | +9 | +7 |
| BEAlb (mEq/L) | +3.75 | +4.5 | +1 |
| BELac (mEq/L) | 0 | −2.4 | −1 |
| BEGap (mEq/L) | −2.85 | −6.9 | −16 |
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Tontu, F.; Çukurova, Z. Unveiling the Gaps: Machine Learning Models for Unmeasured Ions. Diagnostics 2026, 16, 427. https://doi.org/10.3390/diagnostics16030427
Tontu F, Çukurova Z. Unveiling the Gaps: Machine Learning Models for Unmeasured Ions. Diagnostics. 2026; 16(3):427. https://doi.org/10.3390/diagnostics16030427
Chicago/Turabian StyleTontu, Furkan, and Zafer Çukurova. 2026. "Unveiling the Gaps: Machine Learning Models for Unmeasured Ions" Diagnostics 16, no. 3: 427. https://doi.org/10.3390/diagnostics16030427
APA StyleTontu, F., & Çukurova, Z. (2026). Unveiling the Gaps: Machine Learning Models for Unmeasured Ions. Diagnostics, 16(3), 427. https://doi.org/10.3390/diagnostics16030427

