Balanced Meal 
 Creator 

Balanced Meal Creator

An Algorithm that Suggests Foods that Will Balance Out Your Meal

My teammates and I, all students in a Data Science Bootcamp, created the Balanced Meal Creator as our capstone project. My teammates were Madelyn Cruz and Jakeah Phifer. From my passion for nutrition, came this idea to have an app that suggests foods complimentary to an input food, such that all foods together make a meal that meets the reference daily intakes (RDIs) for one meal (one third of the daily targets). While I may have come up with the idea, it never would have come to fruition without Jakeah and Madelyn (many thanks!), who are very talented Python coders. The bootcamp required that the project be coded in Python, which is not my first coding language. I'm a much better Python coder, now, than I was before the bootcamp, thanks to them.

Methods (this may get technical)

We used the United States Department of Agriculture's Food and Nutrient Database to create clusters of foods based on nutrient profile. Foods are very diverse in their nutrient profiles; in our principal component analysis (PCA), we didn't reach 90% explained variance until 15 principal components were included! After the PCA, we clustered using k-means and hierarchical clustering methods, comparing the two. k-means yielded more sensical clusters (smaller cluster sizes and similar foods grouped together), so we used k-means to generate the final clusters for our app.

We calculated the mean nutrient profile for each cluster, then computed combinations of clusters that create a balanced meal. When a user of the app inputs a food, the app identifies to which cluster the input food belongs, and randomly picks a balanced cluster combination that includes the input food's cluster. The app then suggests the most popular foods from the other clusters in that combination.

Popularity of foods was determined by using the National Health and Nutrition Examination Survey (NHANES) dietary recall data. NHANES data comes from a random sample of all United States residents. We extracted a list of foods that U.S. residents reported eating and the frequency with which they ate them. These data were used to create a "popularity index" for each food in the Food and Nutrient Database. The Food and Nutrient Database contains over 8700 foods. Only 1500 of them were reported to be consumed by U.S. residents in the 2017-2018 NHANES cycle. The most popular reported food was actually water!

The Final Product

The final product is the Nutrition Nuts app, which allows users to create balanced meals around their favorite foods. Popular opinion of the field of nutrition is that a healthfiul diet is one of restriction. People think they have to give up their favorite foods, but they don't. This app can help people incorporate their favorite foods into a healthful diet.

When you start typing a food in the app, a drop-down list appears so you can choose from foods in the database. If you type a food that is not in the database exactly, it is mapped to the most popular similar food that is in the database.

2. Recommendations

After a food is selected, the app supplies the most popular foods from complimentary clusters. When the nutrient profiles of the recommended foods are added to the profile of the input food, all of the nutrient targets are met or exceeded.

3. Customize

You can choose other foods from the recommended clusters, if you don't like the most popular ones. Then your balanced meal is complete!

If you want to try out the app yourself, it's on Madelyn's GitHub,  for now. In the future, we may improve the app by making a more accessible web version, allowing users to choose dietary patterns (like vegetarian or paleo, for example), linking to recipes that include the selected foods, and including more nutrients. Right now, only nutrients with RDIs for adults are included. There is no RDI for fiber or macronutrients, though there are other published targets for these nutrients. Another improvement could be ensuring the palatability of the cluster combinations. A meal of butter, sardines, orange chicken, and lentils may not be the most tasty thing you've ever eaten!