The aim of this project was to find out how activities influence my mental focus.
This was the underlying code for my talk at ClojuTRE 2018 titled Optimizing My Mental Focus with Machine Learning and Clojure.
Mental focus was hard to define, so I tracked "Brain Fog" instead, basically tracking my mental un-focus. It's easier to ask yourself "How foggy do I feel today?" instead of "How focussed do I feel today?", at least for me.
Activities can be anything. In my case, I mainly tracked my food because I had this theory (the "Kebab Theory") that certain foods made me feel less focused the next day, especially Kebabs.
I saw this great project for analyzing weight loss data with vowpal-wabbit in the hope of finding out which factors influence weight loss (and weight gain) and tried to apply a similar approach to mental focus while using Clojure.
Simple:
- Collect data
- Parse it
- Shove it into vowpal-wabbit
- Get results and hope you understand them.
Let's go through these steps in detail:
Here's my Google Sheets template.
I used Google Sheets for collecting data. Put simply, you enter all relevant data into the spreadsheet. There are two types of data: Events and Measurements. Events never have values (no value in the value column) whereas Measurements often do.
Measurements are things which matter to you. In my case, my Brain Fog. I would grade it on a subjective scale of 0 (no fog, very focused) to 5 (feeling foggy and unfocused). Further, I would do a Stroop Test every morning which yields some numerical values (time in seconds to complete the test) which I would also enter in the value column.
Check out the template (see above) for some example values.
Protip: ⌘+Option+Shift+; (on macOS) inserts the current datetime into Google Sheets (select a cell first). Check out Help --> Keyboard Shortcuts and search for "date" if you're on another operating system.
I created a tutorial located in
src/correlate/tutorial.clj
!
Important! Do these things first:
Install Vowpal-Wabbit (here on macOS, check the site for more info for your platform):
brew install vowpal-wabbit
Clone this repository:
git clone https://github.com/olieidel/correlate.git
Go to directory and install dependencies:
cd correlate
lein deps
Finally, fire up your REPL of choice and navigate to
src/correlate/tutorial.clj
:)
The code I presented at my talk can be found in the file
src/correlate/clojutre_talk.clj
.
Feel free to reach out to me if things are unclear! :)
Copyright © 2018 Oliver Eidel
Licensed under the MIT License.