Development and Temporal Validation of Explainable Machine Learning Models for Predicting Vitamin B12 Deficiency
Ferhat Demirci1,2, Oktay Yıldırım3, Aylin Demirci4
1Department of Medical Biochemistry, İzmir Tepecik Training and Research Hospital, University of Health Sciences Türkiye, Gaziler Street 468, Yenişehir, Konak, 35120 İzmir, Türkiye.
Diagnostics (Basel, Switzerland)
|February 27, 2026
Summary
Machine learning models can now predict vitamin B12 deficiency using routine lab tests, improving early detection. This approach enhances diagnostic accuracy and supports timely clinical intervention for this common deficiency.
Area of Science:
- Biomedical Informatics
- Clinical Chemistry
- Machine Learning in Healthcare
Background:
- Vitamin B12 deficiency is common but often missed due to unreliable serum B12 tests.
- Current confirmatory biomarkers like holotranscobalamin and methylmalonic acid are not always accessible.
Purpose of the Study:
- To develop and validate explainable machine learning models for predicting vitamin B12 deficiency.
- To utilize only routinely available laboratory tests for prediction, aiding early detection in standard workflows.
Main Methods:
- Retrospective analysis of over 51,000 adult patients' routine lab data and B12 levels.
- Development and validation of eight supervised machine learning algorithms, including temporal validation.
- Performance evaluation using metrics like AUC-ROC, AUC-PR, sensitivity, specificity, and explainability techniques (SHAP, LIME).
Main Results:
- The CatBoost algorithm showed the best performance, achieving high sensitivity (0.92) and AUC-ROC (0.88) in predicting B12 deficiency.
- Temporal validation confirmed robust generalizability with improved discrimination (AUC-ROC 0.90).
- Key predictors included hematologic indices (MCV, HGB, HCT, RDW), iron markers, and age, aligning with known pathophysiology.
Conclusions:
- An explainable machine learning framework effectively predicts vitamin B12 deficiency using routine laboratory data.
- The model demonstrates strong diagnostic performance, biological plausibility, and potential for integration into clinical decision support systems.
- This approach facilitates cost-effective and early identification of at-risk patients, improving diagnostic workflows.
Related Concept Videos
Analysis Methods of Pharmacokinetic Data: Model and Model-Independent Approaches
Drug disposition in the body is a complex process and can be studied using two major approaches: the model and the model-independent approaches.
The model approach uses mathematical models to describe changes in drug concentration over time. Pharmacokinetic models help characterize drug behavior in patients, predict drug concentration in the body fluids, calculate optimum dosage regimens, and evaluate the risk of toxicity. However, ensuring that the model fits the experimental data accurately...
The model approach uses mathematical models to describe changes in drug concentration over time. Pharmacokinetic models help characterize drug behavior in patients, predict drug concentration in the body fluids, calculate optimum dosage regimens, and evaluate the risk of toxicity. However, ensuring that the model fits the experimental data accurately...
Mechanistic Models: Compartment Models in Individual and Population Analysis
Mechanistic models are utilized in individual analysis using single-source data, but imperfections arise due to data collection errors, preventing perfect prediction of observed data. The mathematical equation involves known values (Xi), observed concentrations (Ci), measurement errors (εi), model parameters (ϕj), and the related function (ƒi) for i number of values. Different least-squares metrics quantify differences between predicted and observed values. The ordinary least squares (OLS)...

