Life Story

Blood Sugar Management using Data Science

Deepshree is Type-2 Diabetic. We detected this about 12 years back. Ever since, she is on Insulin. While her condition is stable and she is performing all her daily activities, it requires a lot of management to keep her condition stable. We have had a dedicated Diabetes Specialist for her since 2008.

Doctor’s Monitoring

Initially a Doctor, who was also doing research at Bangalore Diabetes Center, used to monitor Deepshree’s condition. We used to visit him every month and provide him the data we used to collect.

Around 2017, we had to change her Doctor as Dr. Kashinath left Bangalore Diabetes Center. Bangalore Diabetes Center could not find a replacement for quite some time. Also, Dr. Kashinath’s Clinic was very far from our house.

We took a membership at Lifespan Diabetes Center. Here also, we have had a change of Doctor once. However, Lifespan maintains all the data they capture during every visit across Doctors. The data Lifespan captures includes medicines prescribed along with the dosage and the Blood Report details that we provide them on every visit. We take Deepshree’s Blood Report every 3 months which includes Blood Sugar Tests and HbA1c Tests.

Since around 2016, we have been taking the Blood Sugar Count of Deepshree every night before Dinner. Based on the Blood Sugar count, we decide the number of units of Insulin she takes in the night. Deepshree injects Insulin every night before Dinner.

Deepshree’s Activities

Deepshree does all the work in the house and in her office. At home, she cleans the house, takes care of our Pets – Sheru and Baghira (feeding them, cleaning their potty, combing them, etc.), cooks all 3 meals for us on almost 95% of the days, etc.

At office, Deepshree generally has continuous work for 8 hours. Moreover, she works in shifts including night shifts. Earlier, her shift used to change every week. Later, her shifts would change every fortnight. At the moment, for the last 8 months, she works in Morning Shift and Afternoon Shift only. The morning shift is between 6AM to 3:00 PM. And the afternoon shift is between 2:00 PM to 11:00 PM.

Very Strict Food Habits

Deepshree is very disciplined in almost all aspects of life. Especially, ever since her Diabetes was detected, she does not take any sweet. This is even if Family Members, Relatives, Friends or Colleagues insist on it. She is very strict about it. She had to be as when we detected her condition, her Blood Sugar Count is more than 500. After all these years, her Blood Sugar count is generally stable at around 150.

She also generally avoid high carbohydrate containing food including Potato, etc. There are very few fruits that she takes. She totally avoid fruits like Watermelon, Custard Apple, Banana, etc. When she feels like having a fruit, she has Apples, Guavas, Papaya, Kiwi and a few others.

Very recently, from about 2 years back, Deepshree takes Sugar Free Sweets and Sugar Free Ice Creams. She takes Tea or Coffee without sugar. She does not even add sugar free to Tea or Coffee. Sometimes, she takes Health Drinks like Women’s Horlick, etc.

Critical Conditions

In spite of taking care, there are days when Deepshree feels severe conditions when the Blood Sugar count dips. This condition occurs at almost any point of time during the day or night. When it happens at Night, she wakes up from sleep sweating profusely. To bring the condition back to normal, she takes some form of sweet. I keep some sweet filled croissants. We have found that the quantity of Sugar in these croissants is just ideal to settle Deepshree back to normal.

At Office, till date by the Grace of God, Deepshree has never had an awkward situation. However, she always carries some fruits and at least one sweet filled croissant with her. When she feels that she is uncomfortable, she eats the croissant and/or the fruits. Also, she quickly runs around to the cafeteria and eats some snacks so that the Blood Sugar increases.

When Deepshree’s Blood Sugar count is high, she experiences severe body pain. Though she can handle it, it does make her very uncomfortable.

Keeping our own Data

In Jan 2018, I decided to capture data regarding Deepshree’s Blood Sugar condition. By this time, I had been studying Data Sciences for more than 4 years.

I was interested to see if I could find a way to predict the amount of Insulin Deepshree should inject so that there is no discomfort for her the next day.

At the moment, we decide on the amount of Insulin based on our judgement from our past experience. The Doctors are also happy at this modus operandi. The Doctor calibrates the levels of medicines that he prescribes to Deepshree.

I created a spreadsheet and started capturing the following data. Now, it is about 16 months that I have been capturing this data. However, the data set is still very small to apply Predictive Analytics on the same. However, in another 5 years time, the data should be sizeable enough to apply predictive and/or prescriptive analytics. That is the time, when Deepshree will have more need for the same as well.

Here is a list of Data Items that I have been capturing.

The idea is to predict the volume of Insulin to Inject.

1. Date of Recording

I have been recording the Data Every Day since 01-Jan-2018.

This field will be useful when designing Recurrent Neural Network for this problem to provide for Time Series Data.

In normal Linear Regression or Logistic Regression, this field should have no use.

2. Day of the Week

I derive this data from the Date of Recording. This was initially important as Deepshree always had holiday on Saturday and Sunday. However, for the last 1 year, Deepshree’s Week-Off keeps changing.

So, this Data Item can take a Data between 1 and 7, 1 being Sunday and 7 being Saturday.

3. Office Day

As Deepshree’s Week Off keeps changing, I maintain this data Item to record whether Deepshree had office on that day or not. This is also useful if Deepshree is on vacation.

This Data Item can take only 2 values – YES if the Date of Recording was a Working Day for Deepshree and NO if the Date of Recording was not a Working Day for Deepshree.

4. Blood Sugar Count

This is very critical data. As I mentioned before, we take this count every night.

This is a numerical data. This data, along with the other data items, is a critical factor in forecasting what would be the Insulin Volume for the next day.

5. Insulin Volume

For the moment, this is my variable to predict. Keeping the historical values will be used for forecasting the future.

The Insulin Injected on a particular day determines what the condition would be the following day or days. Sometimes when the Blood Sugar Count is very high like 250, it is not possible to inject an unusually high volume of Insulin immediately. Instead, we have to take more than normal volume of Insulin for a few days before the Blood Sugar Count comes down an acceptable level.

This is a numerical data.

6. Medicines Taken

Deepshree is very particular about taking medicines. In spite of this, there are days, when she cannot take medicines as prescribed due to circumstances.

I do not track the Medicines she takes. The Doctors, so far, have not changed her Medicines. However, the dosage has been altered from time to time.

As I do not have much understanding of the Medicines, I do not track particular medicines. Instead, I just track whether the Medicines have been taken or Not.

This Data Item can take only 2 values – YES if the Medicines were taken on the Date of Recording and NO if the Medicines were not taken on the Date of Recording.

7. Breakfast

What Deepshree eats for every meal plays a critical role in how her Blood Sugar Count would be. Generally, we have similar Breakfast every day. However, there are some days, when we skip Breakfast and have Brunch. Also, there are days when we buy Breakfast from Hotels. When we are on vacation, we usually have heavy Breakfast.

This Data Item contains categorical data. The value are as follows:

1 – NO BREAKFAST

2 – LIGHT BREAKFAST

3 – NORMAL BREAKFAST

4 – HEAVY BREAKFAST

8. Lunch

Usually Deepshree has Lunch at predefined times. However, there are days when Lunch gets delayed. This happens especially when she is in the Morning Shift. If she works on a critical issue, she cannot take time off for Lunch. This results in change in Lunch Time and sometimes also change in Lunch taken. Usually, we have Lunch made in house by Deepshree. However, when she has extra work, I get Lunch from Hotel.

This Data Item contains categorical data. The value are as follows:

1 – NO LUNCH

2 – LIGHT LUNCH

3 – NORMAL LUNCH

4 – HEAVY LUNCH

9. Dinner

Usually Deepshree has Dinner at predefined times. Deepshree definitely has dinner as she has to inject Insulin in the night. Usually, we have Dinner cooked by Deepshree. However, there are days when we have Dinner in Hotels.

This Data Item contains categorical data. The value are as follows:

1 – NO DINNER

2 – LIGHT DINNER

3 – NORMAL DINNER

4 – HEAVY DINNER

10. Evening Snacks

This is a big variable. When Deepshree is on Morning Shift or on Holidays, she has Tea with some Light Snacks in the Evening. However, when she is on Afternoon Shift, this is not always possible. During the Afternoon Shift, there is no fixed time when she gets time to have some snacks.

This Data Item contains categorical data. The value are as follows:

1 – NO EVENING SNACKS

2 – LIGHT EVENING SNACKS

3 – NORMAL EVENING SNACKS

4 – HEAVY EVENING SNACKS

11. Sugar Free Sweets Taken

As I mentioned, Deepshree takes Sugar Free Sweets and Sugar Free Ice Creams sometimes. I track the days when she has had this.

This Data Item can take only 2 values – YES if the Sugar Free Sweets were taken on the Date of Recording and NO if the Sugar Free Sweets were not taken on the Date of Recording.

12. Sweets Taken

Deepshree does not take any Sweets under normal circumstances. However, she takes Sweets when her Blood Sugar Count falls. So, I track the days when she needs to take Sweets.

This Data Item can take only 2 values – YES if the Sweets were taken on the Date of Recording and NO if the Sweets were not taken on the Date of Recording.

13. Fruits Taken

Deepshree does take some Fruits.

This Data Item contains categorical data. The value are as follows:

1 – NO

2 – LIGHT

3 – MEDIUM

4 – HEAVY

14. Alcohol Taken

Though very rarely, maybe once in 6 months, we celebrate with some Alcohol.

This Data Item contains categorical data. The value are as follows:

1 – NO

2 – LIGHT

3 – MEDIUM

4 – HEAVY

15. Exercise

Deepshree does some Yoga and walks on the Treadmill for 30 minutes daily. If she is in the Morning Shift, she does this in the evening. If she is in the Afternoon Shift, she does this in the mornings. However, this is not possible when she is travelling or on vacations.

This Data Item contains categorical data. The value are as follows:

1 – NO

2 – LIGHT

3 – NORMAL

4 – HEAVY

16. Travel

I have noticed that Travel impacts the Blood Sugar Count. So, I keep track of the amount of Travel undertaken by Deepshree on the Date of Recording.

This Data Item contains categorical data. The value are as follows:

1 – NO

2 – LIGHT

3 – MEDIUM

4 – HEAVY

17. Afternoon Sleep

Deepshree takes a nap for about 2 hours in the afternoon when she is on Morning Shift or on Holidays. When she has her afternoon nap, she usually feels much better. So, I track this aspect.

This Data Item contains categorical data. The value are as follows:

1 – NO

2 – LIGHT

3 – MEDIUM

4 – HEAVY

18. Night Sleep

Night Sleep is usually huge factor for how Deepshree would feel the next day. So, I track this aspect.

This Data Item contains categorical data. The value are as follows:

1 – NO

2 – LIGHT

3 – MEDIUM

4 – HEAVY

19. Stress Level

I believe and so does the Doctor that it is the Stress Levels which has lead to the Diabetes in Deepshree. So, I track this aspect on a daily basis.

This Data Item contains categorical data. The value are as follows:

1 – LIGHT

2 – MEDIUM

3 – HEAVY

20. Body Pain

On the impacts of High Blood Sugar is Body Pain. So, I track this based on Deepshree’s feedback for the day.

This Data Item contains categorical data. The value are as follows:

1 – NO

2 – LIGHT

3 – MEDIUM

4 – HEAVY

21. Low Sugar Condition

This is one of the variables I would like to predict in the future. I should be able to predict this as a Binary Classification problem when I have sufficient data to train the model. At the moment, I keep track of this aspect.

This Data Item can take only 2 values – YES if Deepshree experienced Low Blood Sugar condition on the Date of Recording and NO if not.

Advertisements

This site uses Akismet to reduce spam. Learn how your comment data is processed.