Predicting blood glucose levels based on past trends.
Using anonymized data from Johnson and Johnson with both the blood glucose level of patients and when they ate and how many carbohydrates their meal had, I implemented a predictive algorithm to help patients discern a safe amount of carbohydrates to eat at each meal.
This was not without its technical challenges, however. One of the biggest challenges was the
lack of direct cohesion between the food data and the blood glucose data. To generate a training set,
I iterated through all of the food data points and found the two nearest blood glucose measurements before
and after eating. I found it to be a reasonable assumption to assume linear increase or decrease of
blood glucose levels over time, so calculated the change in glucose per minute by calculating
(glucoseValue1 - glucoseValue2) / time elapsed glucoseValue1 and glucoseValue2 where glucoseValue1 is the glucose
reading nearest after eating, and glucoseValue2 is the glucose reading nearest before eating.
Download the repository and install the required libraries with
pip install -r requirements.txt.
Adjust the paths to the data files if necessary. To run the script, simply execute