Does Machine Learning Outperform Traditional Fibrosis Scores in Predicting Liver Cirrhosis Risk? A Longitudinal EHR-Based Study
Objective: Develop and evaluate machine learning (ML) models for predicting incident liver cirrhosis (LC) one and two years before diagnosis using routinely collected electronic health record (EHR) data and compare their performance with the FIB-4 and APRI clinical scores. Methods: We conducted a retrospective cohort study using de-identified EHR data from a large academic health system. Adult patients with diagnostic evidence of LC or LC-related risk conditions were identified using ICD-9/10 codes and classified into cirrhosis and non-cirrhosis cohorts. One- and two-year prediction scenarios were created using observation and prediction windows. Demographics, diagnoses, laboratory results, and vital signs from the observation window were used as predictors. XGBoost models were developed with feature selection and Bayesian hyperparameter tuning and evaluated on held-out test sets. The performance of XGBoost, FIB-4, and APRI were compared on the same test data using accuracy, precision, recall, F1 score, AUC, and PR AUC. Results: The final cohorts included 54,365 patients for the 1-year prediction and 43,743 for the 2-year prediction. XGBoost consistently outperformed FIB-4 and APRI across both prediction horizons. The ML models achieved AUCs of 0.834 and 0.811 versus 0.700 and 0.677 for FIB-4 and 0.744 and 0.719 for APRI. PR AUCs were 0.502 and 0.434 for XGBoost compared with 0.310 and 0.241 for FIB-4 and 0.372 and 0.306 for APRI. Conclusions: ML models using routine EHR data substantially outperform traditional clinical scores for early LC prediction, enabling more accurate risk stratification and supporting earlier clinical intervention through automated decision support.