Dataset with features as SNOWMED codes and outputs as names of medications prescribed.What are some ML algorithms that suit this case? So, i am constructing a dataset (from doctor prescription notes and diagnosis) where 

X (input features) represent the various snowmed codes for illnesses/surgeries performed/chronic conditions etc. 

Y is a set of pills prescribed for X. 

Presently I do not have this data in a matrix format. For ex. i have the snowmed codes for an illness that reads as follows: "Diabetes, Hypertension, Cardiac arrest, Left MCA stroke". Y is the set of pills that the doctor noted down for the above. 

As one can note, the above data is not in a matrix format.
There are many snowmed codes and various different pills overall. I'd like to apply ML algorithms to predict the pills for a given set of snowmed codes about the illness. 

How to organize this data in a format convenient for ML? I am open to other analytics approaches as well. Any discussion in this matter will be helpful.
In that case, Multi Class Classification will be the best approach. You can use Neural Network approach or K-Nearest Neighbours for this problem. Your DataFrame is going to be really sparse if you take a numeric approach.

From my point of view, the best approach is to build a vector model.



After you arrange your data this way, it's easier to build a topic model using NLP techniques. It can also tell you which illnesses are most similar and which codes are similar. 

This is what I could think of. These sort of questions are very open ended and can often lead to creative approaches. I am sure there'll be something better if you think hard enough.