I am trying to figure out a good approach to use some machine learning on doctor appointment data. I want to first do an unsupervised clustering to look for any natural structure within the data (there are >6000 people, with >1 000 000 records total). After looking for a structure, could I also use a diagnosis as the outcome?
The first (raw) data form I can use is a record for each appointment a person has, which contains information on diagnosis, month and type of doctor. The doctor type is a flag of either Doc1 or Doc2 or neither. The simplified diagnosis code is a number between 1-20:
ID | Month | Doc1_flag | Doc2_flag | Dx_code
---------------------------------------------------
1 3 0 1 3
1 4 0 0 15
... ... ... .... ...
10 1 1 0 8
10 6 1 0 9
I could also roll this up to produce counts for each year, and create a variable for each diagnosis code to count per year: Dxcount1-Dxcount20
. That would look like (Note - This data example assume more data than I've shown above):
ID | Year | Doc1_count | Doc2_count | Dxcount1 ... Dxcount20
-------------------------------------------------------------------
1 1 10 2 30 4
1 2 3 5 7 5
... ... ... .... ... ... ...
10 1 0 5 14 23
10 2 12 0 9 2
If I were to roll the data up to counts per year I saw this question that I could apply to my data. Would I be able to leave the data in it's raw format and use a hierarchical clustering method? I'm fairly new to ML in it's application, so any further reading for my question would be much appreciated!
Edit: My goal is to look for natural clusters within the data, so do those with more visits to doctor 1 correspond with more diagnosis 2, etc. I could also use the diagnosis as a label for each individual appointment to predict diagnosis based on appointment.
diag1 = flu
,diag2= common cold
, etc.)? $\endgroup$ – Zhubarb May 7 '19 at 13:20diagnosis code
is important not just in classification, but also in clustering, etc. It is the feature representation step which is a prerequisite before feeding your data into any algorithm. $\endgroup$ – Zhubarb May 7 '19 at 13:46