Predicting diet quality and food consumption at eating occasions using contextual factors: an application of machine learning models

Eating occasions (EOs) are important moments for dietary decision-making. Tailoring nutrition interventions to individuals’ behaviours and environmental contexts offers a promising way to modify eating habits at EOs and enhance diet quality. While machine learning (ML) is a useful tool for predicting behaviours, its potential in understanding food choices at EOs remains underexplored. This study uses ML to investigate whether contextual factors can predict food consumption at EOs and overall daily diet quality. Cross-sectional data from the Measuring Eating in Everyday Life Study (MEALS) were analysed. Participants (18-30y, n = 675) recorded intakes for 3–4 non-consecutive days using a Smartphone food diary app. EO-level contextual factors at each EO were recorded via the app while person-level contextual factors were collected via an online survey. Intakes were calculated as servings of vegetables, fruits, grains, meat, dairy, and discretionary foods, in accordance with the Australian Dietary Guideline. Diet quality was assessed via Dietary Guideline Index (DGI, 0-120). Gradient boost decision tree and random forest algorithms were used for hurdle prediction models, with lowest mean absolute error (MAE) as best performing. Mean absolute SHapley Additive exPlanations (SHAP) values were used to interpret the impact of each factor in explaining food consumption predictions. Predictive models performed robustly, with MAE below half a serving for various food groups: 0.3 servings for vegetables, 0.75 for fruit, 0.28 for dairy, 0.55 for grains, 0.4 for meat, and 0.68 for discretionary foods per EO. This indicates small deviations between the model’s predictions and actual intakes. For overall daily diet quality, the model predictions deviated by 11.86 DGI points from the actual score. From mean absolute SHAP values, the importance of predictive factors varied across the six food groups, while for diet quality, the most influential factors were cooking confidence, self-efficacy, food availability, perceived time scarcity, and activity during consumption. ML provided valuable insights into predicting food consumption based on contextual factors. Future research should explore how ML can assist identify key factors that, when adjusted for individual behaviour patterns, encourage healthier eating habits.

Authors

Institutions

Publication Details

Journal
International Journal of Behavioral Nutrition and Physical Activity
Published
2025-11-04
DOI
https://doi.org/10.1186/s12966-025-01818-4
Primary Topic
Nutritional Studies and Diet
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Predicting diet quality and food consumption at eating occasions using contextual factors: an application of machine learning models

Sarah A. McNaughton, Nancy R Tran, Rebecca M. Leech, Yuxin Zhang
International Journal of Behavioral Nutrition and Physical Activity
Nutritional Studies and Diet
article

Predicting diet quality and food consumption at eating occasions using contextual factors: an application of machine learning models

Sarah A. McNaughton, Nancy R Tran, Rebecca M. Leech, Yuxin Zhang
article en

Abstract

Eating occasions (EOs) are important moments for dietary decision-making. Tailoring nutrition interventions to individuals’ behaviours and environmental contexts offers a promising way to modify eating habits at EOs and enhance diet quality. While machine learning (ML) is a useful tool for predicting behaviours, its potential in understanding food choices at EOs remains underexplored. This study uses ML to investigate whether contextual factors can predict food consumption at EOs and overall daily diet quality. Cross-sectional data from the Measuring Eating in Everyday Life Study (MEALS) were analysed. Participants (18-30y, n = 675) recorded intakes for 3–4 non-consecutive days using a Smartphone food diary app. EO-level contextual factors at each EO were recorded via the app while person-level contextual factors were collected via an online survey. Intakes were calculated as servings of vegetables, fruits, grains, meat, dairy, and discretionary foods, in accordance with the Australian Dietary Guideline. Diet quality was assessed via Dietary Guideline Index (DGI, 0-120). Gradient boost decision tree and random forest algorithms were used for hurdle prediction models, with lowest mean absolute error (MAE) as best performing. Mean absolute SHapley Additive exPlanations (SHAP) values were used to interpret the impact of each factor in explaining food consumption predictions. Predictive models performed robustly, with MAE below half a serving for various food groups: 0.3 servings for vegetables, 0.75 for fruit, 0.28 for dairy, 0.55 for grains, 0.4 for meat, and 0.68 for discretionary foods per EO. This indicates small deviations between the model’s predictions and actual intakes. For overall daily diet quality, the model predictions deviated by 11.86 DGI points from the actual score. From mean absolute SHAP values, the importance of predictive factors varied across the six food groups, while for diet quality, the most influential factors were cooking confidence, self-efficacy, food availability, perceived time scarcity, and activity during consumption. ML provided valuable insights into predicting food consumption based on contextual factors. Future research should explore how ML can assist identify key factors that, when adjusted for individual behaviour patterns, encourage healthier eating habits.

International Journal of Behavioral Nutrition and Physical ActivityVol. 22(1)
Deakin University (AU), The University of Queensland (AU)
Openalex Percentile: Top 57%
Nutritional Studies and Diet
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.