Data Science Applications in Healthy Eating and An Anecdote

Jeffrey Ng
4 min readMar 31, 2021
Photo by Dan Gold on Unsplash

Exercise is just one component of a healthy lifestyle. Besides exercise, obviously there is making healthy food choices. This blog is about the intersection fo data science and healthy eating. We will apply machine learning and AI to help us make better food choices. So here we go.

Using data from the US Department of Agriculture, which consists of nutritional information of 7,000 foods, I was able to perform an exploratory data analysis that can help us find out which foods can sabotage diets and which foods can help us. So the first part of my EDA, I constructed a graph that showed us the most sugary foods per 100 grams displayed below.

The piece of data next on the list was to find the least sugary foods per 100 grams which contains 0 grams of sugar. Unsurprisingly, they are vegetables and lean proteins such as tuna, salmon, and chicken.

Next data extraction was to find foods that had the highest calories per 100 grams excluding condiments, sauces, and oils. The EDA shows potato chips, cookies, and granola/nut bars. These foods are primarily junk foods but surprisingly granola bars are not beneficial to people with limited caloric intake requirements.

The next thing I constructed was a machine learning model to predict the amount of sugars in foods. The model I chose was a K-nearest neighbor regressor with five neighbors with weights as ‘distance.’ The features I chose were ‘food category’, ‘calories’, and ‘protein.’ How did the model do? Well the predicted sugars in foods had a mean absolute error 2.2 grams meaning on average, our predictions were off by 2.2 grams of sugar.

ANECDOTE

With the American population approaching 40% obese, restricting caloric intake would be a priority. Although making healthy choices including lifestyle changes and food choices are easier said than done, I think limiting sugar and fat in the American diet and replacing it with lean protein and vegetables is a realistic goal. Adding complex flavors to our foods make it enjoyable, exciting, and most of all healthy. I think it is developing certain habits in our food choices that can raise the level of health of Americans. As a former cook that worked in fine-dining for three years, I can tell you that making healthy food delicious just requires a bit of creativity! Are deep-fried foods really that tasty anyway? For starters, I have included Wil Yeung’s recipe of cauliflower fried rice which is taking the domestic engineer industry by storm. I have tasted this recipe myself and I find it to be delicious with homemade salsa or just by itself!

Ingredients:

2 generous cups of riced cauliflower, 1/2 cup of diced carrot, 2–3 pieces of garlic, 3–4 tbsp grapeseed oil, 1/2 cup of frozen peas, 1/2 cup of frozen corn, 1 tbsp sesame oil, 2 tbsp soy sauce, 1/4 cup fresh chopped green onion.

Directions:

  1. pulse cauliflower in batches in a food processor until consistency of rice
  2. chop carrot, garlic, and green onions into small dice
  3. heat up saute pan
  4. add garlic, and cauliflower. Saute for 2–3 min.
  5. add peas, carrots, and corn. Saute 1–2 min and add sesame oil, soy sauce, and green onion
  6. Saute for another 1–2 min. Serve and enjoy (optional: homemade salsa)

To tell you a little about myself, I thought remaining indoors during this pandemic would certainly sabotage any hope of being in shape. However, I was able to drop 15 lbs. this year while staying at home with a sedentary lifestyle. The most important thing is to eat a diet high in vegetables with minimal fat and lean protein. The weight may not come off but there will be a noticeable difference in your appearance and also how you feel. My reasoning is that there is an internal metamorphosis from eating a diet low in sugar/carbs and high in vegetables and lean protein. I eliminated 2–3 inches off my chest and waist and at the same time making it look leaner. I am not a doctor (however I’ve been a lifelong amateur athlete that perpetually suffered with overweight issues and hence researched and studied nutrition, coupled with my culinary education, with results during a sedentary lifestyle during covid-19), I can say that improving your health and appearance is not far-reaching and entirely impossible.

--

--