Inferring high-fat dietary patterns from electronic health record data using machine learning
Open Access
- 6 January 2026
- journal article
- Published by Oxford University Press (OUP) in JAMIA Open
- Vol. 9 (1)
Abstract
Objectives: Electronic health records (EHRs) rarely capture dietary detail, limiting diet–disease research. We aimed to develop machine learning (ML) computable phenotypes to identify high-fat diet (HFD) using variables typically available in EHRs. Materials and Methods: We used National Health and Nutrition Examination Survey (NHANES) 1999-2020 data, where 24-h dietary recall served as ground truth. Dietary fat intake was summarized into a score (0-30) based on percent energy from fat, carbohydrate, and protein; lower scores indicated HFD. We defined HFD at cutoffs of 10, 15, and 20, and trained ML models (Extreme Gradient Boosting, logistic regression, random forest) using EHR-compatible variables (demographics, comorbidities, labs, anthropometrics). Model interpretability was assessed using Shapley Additive Explanations. To evaluate clinical relevance, we compared cancer associations using ML-predicted vs true diet labels. Results: Machine learning models classified HFD with good performance, strongest at broader definitions. Random forest achieved an F1-score of 0.79 (recall 0.74, precision 0.84) at cutoff 20. Key predictors included race/ethnicity, triglycerides, obesity metrics (body mass index and derived indices), and metabolic panel results. Discussion: These findings indicate that dietary patterns, though seldom recorded in EHRs, can be inferred from routinely available variables. The ability of ML-derived phenotypes to reproduce known diet–disease relationships underscore their epidemiologic validity. Top predictors also align with established biological pathways linking obesity, lipid metabolism, and cancer risk, supporting plausibility. Conclusion: A high-fat dietary pattern can be inferred from EHR-compatible variables using ML-based phenotyping. This approach offers a scalable tool to integrate diet into EHR-based research and precision medicine.Keywords
Funding Information
- National Institutes of Health (R01AG066653)
- National Institutes of Health (R01CA266004)
- National Institutes of Health (R01AG078702)
- National Institutes of Health (R01CA288696)
- National Institutes of Health (RM1NS133593)
- National Institutes of Health (R01AG089445)
- National Institutes of Health (R01AG083039)
- National Institutes of Health (RF1AG084178)
- National Institutes of Health (R01AG084236)
- National Institutes of Health (R01AI172875)
- National Institutes of Health (R01AG080991)
- National Institutes of Health (R01AG080624)
This publication has 32 references indexed in Scilit:
- Food in the Anthropocene: the EAT–Lancet Commission on healthy diets from sustainable food systemsThe Lancet, 2019
- Effects of dietary fats on blood lipids: a review of direct comparison trialsOpen Heart, 2018
- Evaluation of the 24-Hour Recall as a Reference Instrument for Calibrating Other Self-Report Instruments in Nutritional Cohort Studies: Evidence From the Validation Studies Pooling ProjectAmerican Journal of Epidemiology, 2017
- Global, regional and national consumption of major food groups in 1990 and 2010: a systematic analysis including 266 country-specific nutrition surveys worldwideBMJ Open, 2015
- A New Initiative on Precision MedicineNew England Journal of Medicine, 2015
- Behavioral Treatment of Obesity in Patients Encountered in Primary Care SettingsJAMA, 2014
- Dietary assessment methods in epidemiologic studiesEpidemiology and Health, 2014
- Population Approaches to Improve Diet, Physical Activity, and Smoking HabitsCirculation, 2012
- American Cancer Society guidelines on nutrition and physical activity for cancer preventionCA: A Cancer Journal for Clinicians, 2012
- Natural Language Processing Framework to Assess Clinical ConditionsJournal of the American Medical Informatics Association, 2009