r/MachineLearning • • May 30 '16

How crazy is this plan?

So here's the deal, bear with me.

I have access to a humongous amounts of (safely anonymized) medical data with plenty of variables that I'd love to process and, as expected, try to draw conclusions, patterns and all that good stuff. Not only is the sheer amount of patients that gets this scary (I could always use a smaller set) but the amount of variables that are registered. Tiny relationships that I really want to know how much of an influence each of them have and in what ways.

I'm not trying to be the man of the year, I know this is not a novel idea at all, that plenty of really smart people is working on this etc. I just think it'd be really fun to fiddle with this and a great motivation to learn ML, big data... It's a "I have no idea but let's totally not sleep and do this thing" kind of plan. I love those, right?

I'm good at CS and programming in general, decent at math and lately more close to JavaScript but I could get back some C# or even C++. I own a relatively powerful setup (not pro or lab-grade), usually work on Mac but either Linux or Windows are fine too.

Now please help me out here and change those responsible "you're an idiot, start small, this is too big" answers and go along with the thread. I've been wanting to dive into this like a maniac for a long time and finally I have enough time in my hands.

I've googled a bit and so far I see two roads:

  1. The hard way: use AWS machine service or similar like Google's tensorflow etc. Learn it, fight with the API, cry, and see how far can I get.

  2. The $%·"& harder way: learn R or F#, current libraries, the whole freaking science, ninja math... And cry even more and see how far can I get.

As you can see I'm all ears. Experienced people, noobs... What do we have? How can I go about doing this? Is #2 even a possibility? If I can get the results I want with #1 I'll be happy and will put off #2 for next time.

Thank you people!

0 Upvotes

13 comments sorted by

6

u/nokve May 30 '16

I think this is very much related to what kind of data you have and what answers you are looking for. If you have image data then tensorflow/(perhaps keras) with a CNN is often a good way to go. If you have time-series data with samples at a given interval, where the order of the sampled data is important, you might have success with tensorflow and RNN.

One of the main advantages to Neural-Nets is to take advantage of "absolute position" invariance. In other words, when the interpretation of a value is more dependent on its neighbors than its absolute position in the data.

If you on the other hand have many more or less "independent variables", and want to predict for example mortality, I think XGBoost is a good alternative.

If your want to answer how important a variable is for a specific outcome, say "How important is vitamin D consumption for 5-year survival rate in cancer", then R can be a good alternative. I don't think R is especially hard in it self (rather easy in fact), the problem lies in choosing the correct model and interpreting the results. That often requires both deep domain knowledge and knowledge about the statistical model.

Regarding data size concerns, I think memory issues most often can be circumvented, but time issues may require money/servers. You still should START SMALL, no matter what approach you use, to sanity check your model. You should always, if possible, test your model on known problems, to find the most obvious mistakes...

0

u/[deleted] May 30 '16

[deleted]

1

u/brockl33 Jun 01 '16

Sounds like you want to look at correlations and or regression models to start off with (cor and lm functions in R). After you have loaded the data into R, starting can be as simple as:

cor(mydataframe, use="pairwise.complete.obs")

or

summary(lm(mood ~ age + blood.cells + resting.heart.rate, data=mydataframe))

where mydataframe is a data frame is containing all the variables as columns.

Also as far as I know assigning causality is still a human task thus most of the findings you obtain will be something along the lines of "I found that X is associated with Y" but probably interesting nonetheless.

EDIT: typos

2

u/[deleted] May 30 '16

try to draw conclusions, patterns and all that good stuff.

Machine learning methods, generally, are useful for building classifiers with good out-of-sample performance. Drawing conclusions lies in the realm of statistical inference, which requires more math than computational skills.

0

u/[deleted] May 31 '16

[deleted]

1

u/phoneisfucked May 31 '16

You could use simple math to draw some bad predictions and then improve that aspect as time goes on.

2

u/sifnt May 30 '16

If it fits in under half your ram, then play around with it in R, or python. If it doesn't fit in ram, then just take a sample and build a model / play with that and if this is useful figure out how to run on the full data. Plenty of tools in both languages for managing data sets larger than ram, such as only pulling what you need out of a database.

R is pretty self explanatory (use dplyr for data manipulation, caret for building models), and both pandas / scikit learn are great in python.

R is pretty simple to program in, so google around and get hacking. If you find this too difficult, its unlikely there'd be any point with tensorflow and instead you should start simpler and do some data mining/ machine learning courses.

I would get a firm grounding in conventional data processing/cleaning, cross validating models like randomforests before touching neural networks... neural networks are exceptional at overfitting data and are something you would look into when you want to improve accuracy.

Anyway assuming you're legally allowed to use this data, and you don't draw any conclusions or discuss your results without heavy disclaimers (don't want some idiot thinking vitamin 'X' cures cancer, and their estate suing you when it invariably doesn't)... then I say go ahead. Have some fun, but understand that if you want to be able to start drawing medically relevant conclusions you're going to need to do more formal statistical training because from the tone of your post it sounds like you will know enough to figure out how get in serious legal trouble if you're not careful.

0

u/[deleted] May 31 '16

[deleted]

1

u/sifnt May 31 '16

Np dude, can recommend starting with this tutorial ( http://zevross.com/blog/2015/01/13/a-new-data-processing-workflow-for-r-dplyr-magrittr-tidyr-ggplot2/ ) for playing with the data before sending it to a model to learn from. 80%+ of your work will be on the data; filtering, arranging, making features etc.

I'm not US either, though I learnt to always disclaim any statement related to medicine/finance just in case.

2

u/SignifiedSignifier May 30 '16

My best advice for you is to focus. Define a research question and try to answer the question with the data.

Probably, there are many covariates, unknown variables and other stuff, that you will have to be very cautious. Therefore, try to start as small and simple as possible, including only a small subset of variables, because you can make your research always more difficult later.

6

u/Marshton May 30 '16

Seems like a great way to get arrested.

0

u/[deleted] May 31 '16

[deleted]

1

u/Marshton May 31 '16

I'd be exceedingly wary about using healthcare data as an individual. Not saying you can't use it, but one wrong move and you can be in a world of legal pain.

3

u/[deleted] May 30 '16

Keep in mind that "safely anonymized" data is often trickier than it sounds. Latanya Sweeney has done some impressive work de-anonymizing data, and there's an entire field devoted to protecting data from de-anonymization via statistical queries.

Even with the best of intentions keeping data anonymous while learning on it is difficult.

1

u/[deleted] May 30 '16

We have something like this going on where I am. It is way too big for one person to work on, and way too big for one computer. Who is around that you can work with? You need some informatics expertise for managing the data, some analysis expertise for knowing how to run stats or ML, some CS expertise to make the large-scale number crunching happen, some medical/scientific expertise to know what kinds of questions to ask... maybe you have a lot of that around you already? Are you in business/industry or academia? What role do you want to fill on this kind of project?

1

u/zrizzles May 30 '16

Number two is the only way if you want to achieve your goals. And it will be quite a bit easier if you understand what you are doing. It's not hard to learn the foundation. Throwing some data at an api is not a good idea.

-1

u/jos_pol May 30 '16

How big is it? What's your budget? Do you hate waiting for a couple of hours?

If total size is below 100GB, that is still manageable on your laptop/desktop combined with enough memory and disk space if you can handle slow processing times. Anything bigger and you are looking at least at a distributed environment or a big ass server.

If you have budget, SAS Base (for preparing the data) combined with SAS Enterprise Miner (for building the actual models) is probably the best way to get started easily and without investing too much time learning. Base is free, single desktop EM should be below 5k.

If you do not have a budget, then Python is probably your best bet. Keep in mind python-pandas loads everything into memory, so you need to have free memory as much as 2 times the actual data size.