#250 - Life Tracker Refactor
Motto: Diagnostics, on a Personal Level
In Column #242 I wrote about the Life Tracker pretty extensively. While Melissa was out of town last week at Starvy Creek Bluegrass Festival I did something I wasn't able to do when she went to Los Angeles: Utilize my time productively.
The Life Tracker has been revision bumped from 2.0 to 3.0. It was a complete, bottom-up rewrite of what I spent weeks coding a couple years back; and I accomplished it in less than two days. In Column #242 I outlined some goals. Here's a report card for how I did:
Goal: Less Reliance on Google
The Life Tracker 3.0 is still hosted on Google Scripts & Google Spreadsheets. It utilizes a Google Form for input. Given all these facts, though, I was still surprisingly successful. My old code read like "take this thing from this exact spot on the form and and put it on this exact spot on the spreadsheet". My new code is broken down into many functional blocks - only the first and last of which have anything to do with Google Forms or Google Spreadsheets. Everything in between is self-contained. I could easily port the middle (vast majority of the program) to another platform.
Goal: Automatic Data Entry
This has been a massive success. I used to pull up 5 apps to do my data input. Now I'm using two apps. Soon I'll be down to one. My scripts automatically pull my heart rate, weight, pedometer, estimated caloric burn, and any exercise information from their respective apps on my phone. From a different source, I am automatically pulling in the weather. My code will soon be capable of pulling Nutrition information as well.
Cool side note: I found a bug in Google's APIs, brought it to their attention, and was told "yup that's a bug, we'll fix it". Aaron Gillespie had an admittedly small but measurable affect on Google's code. #Legit #TooCool #Hashtag
Goal: Not Just Me
This one I've been less successful with. As of right now, the code is flexible enough to handle the addition or subtraction of tracking points with little hassle, but it certainly needs to be touched if someone else were to want to use my system. It's much better than it was, certainly.
I have given this one a ton of thought and have some ideas that I'll work on next time Melissa is out of town. Also, to really develop a generalized "Life Tracker" system, I'd need to find a volunteer assistant who'd be willing to work with me to define their goals, wants, and give me feedback on bugs & whatnot.
Goal: Support for Incomplete Datasets
This was another massive success. So much so, that I've retroactively went in and added (mostly blank) rows for every week that I missed in the past two years. My code handles missing data without fail (yet), and the analytics takes into account holes in the data. Each day now has an (automatically calculated) level of "Completeness" that I can use to see how diligent I've been in my tracking. Over the 4th of July I didn't track food, but I still have most of my health data, journal entries, and other data points. Overall, it's 90% there. It used to be that missing that one thing would have killed not only that day, but that entire week. I'm very glad to have fixed this issue.
Goal: Refined Tracking Points
This is complete. I'll cover more on this in the Top 5.
Refactoring the Life Tracker is this month's 30 Day Challenge. This is a transition line.
So. What's it like to actually USE?
I use several apps for their respective purpose:
- LifeSum for food
- Google Fit for exercise & heart rate
- Sleep as Android for Sleep
- Withings Health Mate + smart scale for weight & heart rate
Each night I fill out this form:
This whole paragraph is a link to a duplicate of the form I fill out. It's not the live form, so you can go nuts checking it out or filling it out with whatever data you want. No skin off my back.
At the end of the day, I get a new row in a spreadsheet that looks like this (but all one one line):
For the picture(s) to go out on, I'll leave you with some charts that were not possible on pre-3.0 versions:
None of the new metrics have been around long enough to show meaningful correlations, but I expect there will be some.
TL;DR - The Life Tracker 3.0 is a (mostly complete) total rewrite of my project. It's successful on multiple levels. It already accomplishes most of what I set out to do, and will continue to improve with time.
Top 5: Additions to My Tracking Points
5. Money! I successfully built money into the Life Tracker for the first time. It's not kept up-to-date on a daily basis, but I've made it as easy as 3.14159265358979323846264338 to import from Mint. This data won't be so useful on a day-to-day basis (I anticipate an inaccuracy of ~72 hours invoked by standard commercial behavior), but it's still valid on a month-by-month basis.
4. Weather! The weather happens every day, regardless of my behavior... but perhaps the weather influences my behavior. The weather is automatically imported for each day, based on the location information I input when I fill out the form each night.
3. Tags! A tag-based system for daily-effecting events and for exercise. Day Tags are such things like "napped" or "day off work" wherein I can specify certain attributes or events a day might have. Exercise tags enable me to specify what I accomplished on a more granular level than before. I used to have a list of 5 different genres of exercise. Now I can say I tag "circuit, lower, cardio, and twoaday" to denote doing a circuit-based workout for my legs and, separately, some form of cardiovascular exercise.
2. Completeness! A "completeness" metadatum is now included. This automatically added figure is a measure of how "sloppy" I've been with recording things. This feature is actually much larger value-add than I anticipated. It tells me that I tracked 45% of 2013, 61% of 2015, and 59% of 2015 so far. I expect those completeness figures to go up now that missing a single day's worth of any one point doesn't kill all points for the entire week.
1. I'm newly tracking location, wake up times, exercise start & stop times, exercise duration, water intake, average heart rate, estimated caloric burn, lag time between data entry & data dates, Tracker version number, an optional daily "reference" (for things I know I'll need to remember later), and official spots for my 30 Day Challenges and their results. These are cut & dried additions, but in aggregate they are huge. More importantly, I managed to add all of things while reducing the amount of work I have to put in on a day-to-day basis to keep track of it all.
"You sound like a mad scientist"
- Melissa, after telling her I coded stuff for 8 straight hours -