Recommender System Based on Collaborative Filtering for Personalized Dietary Advice: A Cross-Sectional Analysis of the ELSA-Brasil Study

Int J Environ Res Public Health. 2022 Nov 13;19(22):14934. doi: 10.3390/ijerph192214934.


This study aimed to predict dietary recommendations and compare the performance of algorithms based on collaborative filtering for making predictions of personalized dietary recommendations. We analyzed the baseline cross-sectional data (2008-2010) of 12,667 participants of the Brazilian Longitudinal Study of Adult Health (ELSA-Brasil). The participants were public employees of teaching and research institutions, aged 35-74 years, and 59% female. A semiquantitative Food Frequency Questionnaire (FFQ) was used for dietary assessment. The predictions of dietary recommendations were based on two machine learning (ML) algorithms-user-based collaborative filtering (UBCF) and item-based collaborative filtering (IBCF). The ML algorithms had similar precision (88-91%). The error metrics were lower for UBCF than for IBCF: with a root mean square error (RMSE) of 1.49 vs. 1.67 and a mean square error (MSE) of 2.21 vs. 2.78. Although all food groups were used as input in the system, the items eligible as recommendations included whole cereals, tubers and roots, beans and other legumes, oilseeds, fruits, vegetables, white meats and fish, and low-fat dairy products and milk. The algorithms' performances were similar in making predictions for dietary recommendations. The models presented can provide support for health professionals in interventions that promote healthier habits and improve adherence to this personalized dietary advice.

Keywords: algorithms; collaborative filtering; diet; dietary advice; recommender system.

Publication types

  • Research Support, Non-U.S. Gov't

MeSH terms

  • Animals
  • Brazil
  • Cross-Sectional Studies
  • Diet Surveys
  • Longitudinal Studies
  • Vegetables*

Grants and funding

This research received no external funding. However, the ELSA-Brasil study was funded by the Ministry of Health of Brazil, the Ministry of Science, Technology and Innovation, and the National Development Council Scientific and Technological Advice, grant numbers 01 06 0010.00 RS; 01 06 0212.00 BA; 01 06 0300.00 ES; 01 06 0278.00 MG; 01 06 0115.00 SP; and 01 06 0071.00 RJ. Funding received at the study baseline had no influence on the design, analysis, drafting, interpretation, or decision on the version submitted for publication.