Skip to content

apiispanen/biohacker

Repository files navigation

Biohacker

My personal mood tracker & predictor.

To find the deployed online application, please see: The Deployed Streamlit Webapp

To learn more about this project, please see: Medium Post

Overview

Biohacker is a database used to track my moods. As I evaluate myself on a 5-point Likert scale (found here here), my tracker will integrate with an algorithm designed to combine this data with any activity, financial and locational data that I have that could play into this. Have I been buying too much take out food? Do I visit people who I don't enjoy being around? Does sitting inside for 48 hours straight really contribute to my mood? In this process, I want to uncover everything about myself - getting down to the deepest parts of me I didn't know existed. I'll add as many variables for analysis as I go, but this is a personal experiment on myself.

Purpose

In order to find the biggest causes to my mood changes, Biohacker was designed to log my mood while analyzing all other environmental and personal data that has been collected on my behalf during the day.

Data Being Collected

Currently, there are two types of data being collected in this series:

  1. Active Data: Active data requires manual input and consistent logging. In the case of this study on myself, this is my mood. Any other data that I have to pick up a device to add to during the day (i.e. "What activities are making me feel this way today?") is also considered to be active. The mood will serve as the most important predictor in this study.
  2. Passive Data: Passive data is all the background noise that gets collected in our phones. This is the app data, the step counts, the number of times your phone was picked up. All of this gets logged somewhere, and Biohacker's job is to reconcile this all in one place. Essentially, you become a part of your own study here.

Data Extractors

Pull_Sheet.py

This is the main sheet that pulls our Google Forms Data & our current gym log. As the interface develops, so will this portion of the database. As of now, a dataframe of three columns are returned:

  • timestamp
  • mood: The 1-5 scale that was actively entered into how you feel.
  • gym: a binary (0 or 1) number that dictates if on this date the gym was visited.

Health.py

This data is pulled from Apple Health. Go to Apple Health App, click on your account and "export all data" to obtain your own information. The data is exported as an XML file, and then health.py reads the data to splice the data and reconfigure it to the different types of data present:

  • Mindful minutes: The daily sum taken from the duration (endDate - startDate)
  • Total steps: The daily sum of steps taken.
  • Total Flights Climbed: The daily sum of flights climbed.
  • Total standing: The total percent of standing time - may not be useful as a variable.
  • Total walk-run: The total percent of walk-run time - may not be useful as a variable.

weather_pull.py

Using the free Open API open-meteo, this script is able to grab us these variables for each day we analyze:

  • apparent_temperature: The "realfeel" temperature, when factoring in misc. variables such as windspeed and humidity.
  • cloudcover: Percentage of the total cloud coverage that day.
  • precipitation: Including rain and snow

pickup_pull.py

Combining the app Offscreen with the power of Python's Pandas library, this script combines the exported data from the free application into 2 insights:

  • Total count of pickups each day
  • Total screentime logged

Packages Used

  • Python Libraries: Oauth2client, gspread, plotly, numpy, streamlit (for data vis renderings), lxml, requests, pandas, datetime, pprint, numpy, sklearn
  • Streamlit Cloud
  • Jupyter Notebooks
  • Google Forms
  • IFTTT (for daily pings of Google Forms)

Applications Used for Data Collection

Data Type: Application Used

  • Screentime: Offscreen
  • Apple Health: Account -> "Export All Health Data"
  • Chase Credit Card: Download all records as CSV
  • Gym Visits & Mood: "Manually" entered via Google Forms and gspread connection
  • Weather API: Meteo Open API

Release Notes:

2-10-2023: Imputers have been added so any unfilled data reads for the mean, 3. This is due to the fact that there was nothing notable to log, which should consider the day to be a normal one.

NEXT STEPS: ADD SLEEP TIME BASED ON LAST DAILY PICKUP AND FIRST MORNING PICKUP

Interface design & strongest P values.

Add methods to the README

Releases

No releases published

Packages

No packages published

Languages