cjroth / lifetracker

An open source, hackable tool for discovering your quantified self data.
http://cjroth.github.io/lifetracker/
9 stars 0 forks source link

New data type "enum" #81

Open L3viathan opened 9 years ago

L3viathan commented 9 years ago

It would be cool to have a new data type, that I'll call enum, additionally to the existing scale and number. It would work like enums in programming languages that have them, i.e. a set number of user-defined named values. This also enables binary variables, if the user calls the values e.g. "yes" and "no". (e.g. "Did you drink last night?"). Example for a use of enums with more than two variables could be: "What did you have for lunch?": "Pizza"/"Pasta"/"Falafel".

cjroth commented 9 years ago

I agree that this would be nice to have in some form or another. Actually at one point I had a boolean type but I removed it for the sake of simplicity because I couldn't come up with a satisfying way of visualizing/charting it and I realized that most things that can be true or false can just as easily be described on a scale - eg "Did you go to the gym today?" could be "How much time did you spend at the gym today?" I also agree that enum would be a more flexible version of a boolean type.

Another thought too though is that if you are looking to capture qualitative data as well as quantitative (eg the use case for enums), I think it might be better captured by adding notes to data points or days. My reasoning here is that there's no good way to visualize and find correlations with enums since they aren't numerical, but you could totally throw that data into notes which could be available when you click on a particular day or data point.

Within the notes feature too, you could add tagging/tokens if you want to reference specific things repeatedly, like "Pizza" in such a way that you can get all "Pizza" referencing data points later.

Thoughts?

L3viathan commented 9 years ago

Within the notes feature too, you could add tagging/tokens if you want to reference specific things repeatedly, like "Pizza" in such a way that you can get all "Pizza" referencing data points later.

That doesn't do what I want though: Finding correlations between enums and other variables like mood ("How good do I feel when I eat Pizza compared to when I eat something else?")

enums aren't on a scale, yes, but in a sense they are numerical; you can treat every possible value as an integer. I don't know what kind of learning algorithms you use; I haven't looked into the code, but I don't think it's a very hard problem to find correlations here, not harder than anywhere else at least.

Where I agree with you is the visualization problem. I also have no idea how you could do that… on the other hand I haven't seen any other graphs of lifetracker either (just downloaded it today). If you compare one numerical variable with an enum, you can have different coloured curves on a graph, were each colour represents an enum value. But then again, I don't know anything about visualizing data beautifully, really.

If you won't implement it, I will probably use a enum of "order" n as n "binary"/(number where I only enter zero or one) features.

cjroth commented 9 years ago

I'm open minded. Wanna send me a pull request?

L3viathan commented 9 years ago

I'll try to look into it later. What do I need to build it? Merely calling build.sh does not do it, even with Lifetracker.app in the same directory:

image

cjroth commented 9 years ago

I'll have to update the README with instructions when I get a chance.

You just need to put an empty node-webkit app in the project directory, install node and bower modules, and then run run.sh.