Appendix F. Data Science Case Study: Intermittent Fasting

Back in the early 1990s I attended Cal Poly San Luis Obispo and majored in nutritional science. I picked this degree because I was obsessed with being a professional athlete. I felt like studying nutritional science could give me an extra edge. I first found research about calorie restriction and aging.

I was also involved in self-experimentation in my nutritional biochemistry class. We centrifuged our blood and calculated LDL, HDL, and total cholesterol levels. In the same course, we supplemented with megadoses of vitamin C and then captured our urine to see what was absorbed. It turned out that nothing was absorbed in a healthy population of college students because the body intelligently responds to the absorption of nutrients by increasing absorption sensitivity when levels are low. Vitamin supplements are often a waste of money.

I took a year of anatomy and physiology and learned how to dissect the human body. I learned about the Krebs cycle and how glycogen storage works.1 The body produces insulin to increase blood sugar and stores it in the liver and muscle tissues. If those areas are “full,” it puts that glycogen into adipose tissue, or “fat.” Likewise, when the body is out of glycogen or aerobic activity is underway, fat tissue is the primary fuel. This storage is our “extra” gas tank.

I also spent a year at Cal Poly as a failed Division I Decathlete walk-on. One of the things I learned the hard way was that doing too much weight lifting was actively detrimental to performance in sports like running. I was 6’2”, 215 lbs, and could bench press 225 around 25 times (similar to an NFL linebacker’s bench press performance). I also ran the 1,500m (about a mile) in 4 minutes and 30 seconds and regularly led the pack in three-mile training runs with Division I long-distance runners. I could also dunk a basketball from near the free-throw line and ran the 100m in 10.9.

In a nutshell, I was a good athlete and well-rounded but actively worked for years doing the wrong types of exercises (bodybuilding). My work ethic was off the charts but also wildly ineffective and counterproductive for the sport I chose. I also overestimated my ability to walk on to a Division I sport where I hadn’t even done many activities, like pole vault. I almost made the team too—there was one person in front of me. In this part of my life, though, “almost” didn’t count. This experience was the first time I had given something my entire focus and effort, yet ultimately failed. It was a humbling experience that was good to get out of the way early in life. I learned about dealing with failure, which has served me well in software engineering and data science.

As a former Silicon Valley software engineer, I later discovered a word for this behavior: YAGNI. YAGNI stands for “You Ain’t Gonna Need It.” Just like the years I spent putting on 40 pounds of extra muscle that ultimately decreased my sports performance, you can work on the wrong things in software projects. Examples of this include building functionality that you don’t use in an application or overly complex abstractions like advanced object-oriented programming. These techniques are literally “dead weight.” They are actively harmful because they take time to develop, which could be spent working on valuable things, and permanently slow down the project. Like in my track and field experience, some of the most motivated and talented people can be the worst abusers of adding unneeded complexity to a project.

The field of nutritional science has a YAGNI problem as well, and intermittent fasting is an excellent example of a simplification technique. It works a lot like the way deleting half of a 2,000-word essay can make it better. It turns out the decades of added “complexity” in food can be ignored and deleted: frequent snacks, breakfast, and ultra-processed foods.2

You don’t need to eat breakfast or snacks. To further simplify, you don’t need to eat many times a day. It is a waste of time and money. You also don’t need ultra-processed foods: breakfast cereal, protein bars, or any other “man-made” food. It turns out YAGNI strikes again with our diet. You also don’t need to buy a unique tool to eat healthy, like books, supplements, or meal plans.

There is a well-known problem called the traveling salesman problem,3 which asks the following question: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city? The problem is essential because there is no perfect solution. In everyday language, this means a solution is too complex to implement in the real world. Moreover, it would take an increasingly long time to create an answer concerning the data. So instead, computer science solves these problems using heuristics. I wrote a heuristic solution in graduate school that isn’t particularly innovative, but it comes up with a reasonable answer.4 The way it works is to pick a city randomly, then you always choose the shortest route when presented with possible routes. At the end solution, the total distance calculates. You then rerun this simulation with however much time you have and then pick the shortest distance.

Intermittent fasting is so effective because it also skips past the unsolvable complexity of counting calories to lose weight. Intermittent fasting is an effective heuristic. Rather than counting calories, instead you don’t eat during blocks of the day.5 These blocks could be as follows:

Daily fasts:

  • 8-hour feeding window or 16:8

    • 12p.m.–8p.m.

    • 7a.m.–3p.m.

  • 4-hour feeding window or 20:4

    • 6p.m.–10p.m.

    • 7a.m.–11a.m.

Longer fasts with more complex patterns:

  • 5:2

    • Five days of normal eating and two days of calorie restriction, typically 500 calories.

  • Alternate-day fasting

    • Eat normally one day and restrict calories another, typically 500 calories.

I have experimented mainly with daily fasts of 16 hours or 20 hours. As a data scientist, nutritionist, and still competitive athlete, I also come with data. I have data from 2011–2019 of my body weight.6 From August 2019 to December 2019, I have mostly been on a 12:8 IF routine.

In Figure F-1 I am able to use the data collection from my scale to perform data science on my own body and figure out what works and what doesn’t.

pmlo ae01
Figure F-1. Body weight

One thing I learned in analyzing body weight and experimenting with data is that a few small things make a big difference:

  • Avoiding “human-made” food

  • Getting 8 hours of sleep (MBA and startups caused weight gain through sleep loss)

  • Daily exercise

  • Intermittent fasting

  • You cannot exercise your way out of a bad diet (heart rate was in the low 40s)

Figure F-2 shows an example of a meal that is YAGNI-approved.

pmlo ae02
Figure F-2. Healthy food: avocado omelet

Here’s the recipe for a mushroom omelet with avocado:

  • Eggs

  • Shiitake mushrooms

  • Cheese

  • Avocado

  • Salsa

It takes only a few minutes to make, the fats and whole foods make you feel satiated, and it is inexpensive.

When was I “overweight” it was in periods when I didn’t follow the previous advice: working crazy hours at startups, eating food that “human” made. Working out in a fasted state takes a bit of getting used to, but I found that it increases performance in many sports I do: bouldering, weight lifting, HIIT training, and Brazilian Jiu-Jitsu. Likewise, I am very productive in writing software, writing books, and doing intellectual work. My main “hack” I add is the regular consumption of plain cold brew coffee and water.

My conclusion is that intermittent fasting is one of the best ways to enhance a person’s life dramatically. It costs nothing and is simple to do, primarily if you practice it daily, and is backed by science. Additionally, many people struggle to find data science and machine learning projects to work on that are interesting. Why not use yourself as the test case, as this case study shows?

Notes on Intermittent Fasting, Blood Glucose, and Food

From the New England Journal of Medicine (NEJM), “Evidence is accumulating that eating in 6 hours and fasting for 18 hours can trigger a metabolic switch from glucose-based to ketone-based energy, with increased stress resistance, increased longevity, and a decreased incidence of diseases, including cancer and obesity.”

From NHS (Nurse’s Health Study), “Several lifestyle behaviors may influence whether or not a person can maintain energy balance over the long term. For instance, the consumption of sugar-sweetened beverages, sweets, and processed foods may make it harder to do so, whereas the consumption of whole grains, fruits, and vegetables might make it easier.”

This also shows a data science and machine learning approach to solving obesity. Increase the number of servings of nuts, fruits, and yogurt. Decrease or eliminate potato chips, potatoes, and sugar-sweetened beverages (note that there is a link between ultra-processed foods and insulin spikes). These are the top foods that contributed to weight gain:

  • Potato chips

  • Potatoes

  • Sugar-sweetened beverages

These are the top foods that are inversely associated with weight gain (weight loss):

  • Nuts

  • Fruits

  • Yogurt

Lifestyle changes like IF certainly are easier to attempt when you can already see the data behind it!

1 See the citric acid cycle page on Wikipedia.

2 See “Eating More Ultra-Processed Foods May Shorten Life Span” in Harvard Health Publishing.

3 See the description on Wikipedia.

4 This is available on GitHub.

5 See DietDoctor and the New England Journal of Medicine for more.

6 This is available on GitHub.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
54.163.14.144