ifmeorg / ifme

Free, open source mental health communication web app to share experiences with loved ones
http://www.if-me.org/
GNU Affero General Public License v3.0
1.48k stars 742 forks source link

(Periodic) Data Analysis and Statistical Predictions? #159

Closed markfarrell closed 6 years ago

markfarrell commented 8 years ago

I understand that mental health is a complex issue, and so I'm not entirely sure what would/wouldn't be feasible in terms of adding data analysis, predictions, recommendations features, etc. to ifme without having to compromise the app, more or less. I thought @julianguyen mentioned before as well that partly why she started ifme was because she didn't like some other apps out there that oversimplify and statically formalize mental health too much, to the point where it's treated like a "video game". @julianguyen could you confirm, or elaborate on that a bit it, in this context?

Anyways, I'm still curious about at least talking/thinking about how in theory, data analysis, prediction, recommendation features, etc. could be added to ifme, and how that might work/possibly align with ifme's goals. For example, if it were possible to assign measures to moments (e.g. suppose 0 is a neutral moment, negative numbers are "bad" moments, and positive numbers are "good" moments), and perhaps if some other forms of measurable data were available from users, then what data analysis and predictions would hypothetically be possible with ifme? Imagine if it were possible to predict when somebody is going to have a mental health crisis relapse, and the app could help them prepare for it some way (possibly even notify allies/support groups), before it happened. If it could, then I suspect the app could really help some people progress with their mental health goals via forecasting crises and getting the support they need in advance; would you agree? Could this possibly work? Or, would any attempts to make data from the app measurable, consequently formally constrain it too much?

What are your thoughts on this?

julianguyen commented 8 years ago

@markfarrell I noticed other mental health apps provided anonymous support or self-tracking without sharing. I want if me to be a tool you can use transparently with your loved ones :)

I totally agree that data analysis, prediction, and recommendation features would be very beneficial. Hmm the rating system for Moments you are talking about is interesting...

I've refrained from adding a numerical rating/tracking system is because it's not always an accurate way to describe how are you feeling. But if you or anyone could come up with a way to have the existing system of writing down symptoms, feelings, moods, etc. and also have an additional rating system, then that would make data analysis and prediction/recommendation a lot more feasible.

Thanks for bringing this up!

julianguyen commented 8 years ago

Thoughts @Dragonfly99? (Kerry is passionate about data science) :)

Dragonfly99 commented 8 years ago

Thanks for Tagging me Julia. Hello by the way Mark.

From what I understand so far, the prediction and analysis that you're asking for and would be really great for this app to have follows the realm of machine learning. It's not something I've dabbled in to much but you want to have this kind of feature at its best you'd want someone with a bit more experience than me.

I can learn enough to possible help implement basic machine learning programs but I don't have the statistical or mathematical skills to pull off prediction. I'd do better with drawing insights.

To rephrase a bit @markfarrell what you're asking about is something that's doable and could be a great boon to this app. I think I can ask around my field to ask more about how to really start implementing and/or try to bring someone on board who already has the skills.

Once there's enough users and activity I can analyze their data in conjunction with @julianguyen and the rest of you to see what we can garner and how we can improve. I hope this helps a bit.

julianguyen commented 8 years ago

Thanks for your insights Kerry :)

The only "analysis" we do so far is a simple indicator to display your most used Categories, Moods, and Strategies

screen shot 2016-05-27 at 10 58 56 am

Do either of you @markfarrell @Dragonfly99 have any ideas on what else we could display to users based on their inputted data?

markfarrell commented 8 years ago

Hi Kerry, nice to meet you as well, and thank you for your input.

In terms of what to add right now, I think I need to still keep using the app more and entering data in order to know what immediately actionable advice to offer with regards to analytics. However, even right now I can think of a few immediate questions that I have, but currently have to think about how to answer manually first, I suppose:

What are you thoughts on these questions, and how to possibly answer them?

julianguyen commented 8 years ago

Wow great questions @markfarrell!

RE your points:

opensorceror commented 8 years ago

Interesting stuff! Maybe you can let users view stats about strategies that other users are using. For example:

  1. Using collected data to find out which strategies are the most widely used and which yield the best results. This data could even be useful for psychiatrists!
  2. Letting users see what people most similar to themselves (in terms of age, gender, profession, hobbies and interests, et al.) have been doing to overcome their mental illness. If I as a teenager suffer from anxiety, it would help to know how other teenagers have modified their lives to overcome it.
  3. Learn from users' strategies and recommend strategies to other similar users (Think amazon's recommendation system). You can use a simple ML algorithm such as a Clustering algorithm/Association rules/Tag similarity and then work your way up to complex associative classifiers and neural networks.

I have not been following if-me, but if I suffered from a mental illness and used if-me, I as a user would like to see these features on the website.

Cheers,

On Tue, May 31, 2016 at 9:19 PM, Julia Nguyen notifications@github.com wrote:

Wow great questions @markfarrell https://github.com/markfarrell!

RE points:

  • I can quickly add a counter!
  • Very interesting. What would plot? How often someone logs a Moment?
  • Would a rating system help?
  • This is a very open ended question. It would great to build tools anyone can use to figure that out. People's goals differ from each other a lot, so I don't think we should focus on a specific goal.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/julianguyen/ifme/issues/159#issuecomment-222867445, or mute the thread https://github.com/notifications/unsubscribe/AJtmO__ER3UKLJmwx47plbbL90yp9Af7ks5qHN4egaJpZM4InU4e .

nma commented 7 years ago

I think the first step to any of this is to provide an API for users to retrieve their data in various simple formats to begin mining. Once we have a way to slice and dice the data from the Rails app:

e.g.

GET   /v1/analytics/moments?count&format=tsv
GET   /v1/analytics/moments?start_date=march10th&end_date=june10&format=json

We can then pipe the data to various processing services. So for example, this month I want to know how many times the work "work" showed up in my moments, and how was the sentiment of each moment was.

GET   /v1/analytics/moments?start_date=nov10th&end_date=dec10&format=json
[{
   "emotions": ["thing"],
   "moment": "<text>",
   "start_date": "",
   "end_date": "",
},
...
]

My own server can stick it to elasticsearch, then ask lucene to give me the moment records that contain "work".

if-me.org  |  elasticsearch  |   filtered records

I can then pass the filtered records, and run them through a worker that does sentiment analysis and then I end up with modified records.

[{
   "emotions": ["thing"],
   "classified_keywords":  ["work", "chore", "poop"], 
   "sentiment":  "-1",
   "moment": "<text>",
   "start_date": "",
   "end_date": "",
},
...
]

If we like this output, we can then make a custom Strategy Extension that will call my worker, and spit this out to a new UI.

All these possibly ideas open up once we have a consistent and reliable way to get data out of the system, so for V1 I would suggest to purely focus drafting out an analytics endpoint just for moments.

Make it easy to do so that I can pass it into an Ipython notebook, then we can experiment with whatever data processing or correlating that is needed.

This way, the analytics endpoint will figure out how to ask database for records by itself, the rest of the app's development can happen in parrallel.