I have a dataframe shaped something like this

patient_id admission_id admit_date diagnoses
1 1 2125-10-18 [1,2]
1 2 2125-10-26 [1,2,3]
1 3 2125-11-30 [1,2,3,4,5]
4 7 2130-06-23 [2,3,4,7,9....]

The task is to make predictions of the diagnoses at a future date based on prior medical history. However, I'm not sure how to train a model or how to make the train-test split since there are multiple patients with multiple admissions. I was thinking this could be a multivariate problem but I'm not quite sure how to encode that either. The dates between admissions for the same patient vary a lot too, anywhere between 7 days to ~2 years. They're also rarely any overlap of admit date between multiple patients.

One thing I could try is to split each patient into their own df but that would be more of a workaround than a solution.

Apologies if the title is incorrect. I'm relatively new to ML so I don't know exactly what kind of problem this would be.

  • $\begingroup$ Welcome! This sounds like an interesting problem. How many unique diagnoses are there? $\endgroup$
    – m13op22
    Feb 5 at 14:22
  • $\begingroup$ @m13op22 There are several thousand unique diagnoses (diseases)but they've been filtered to the most frequent 100. Here are some stats: Unique patients: 2851 Unique dates: 23266 Average number of admissions per patient: 14.34 $\endgroup$
    – Orange248
    Feb 5 at 19:29

1 Answer 1


make predictions of the diagnoses at a future date based on prior medical history


Note that ICD10 groups ailments hierarchically, and it seems reasonable to score a win if a patient with complex emphysema issues is admitted with "lung1" symptom and then is predicted to be admitted with a similar symptom when ground truth says it was a related "lung2" symptom.

One possibility for scoping down this ambitious problem is to segregate patients into Simple and Complex health histories. The Complex patients may actually be easier to deal with, given their repeat admissions for related issues.

It is possible that the input dataset reveals genetic or environmental predispositions to disease, based other patient histories in the dataset.

Every patient has mammalian organ systems, and the ICD10 hierarchy reflects that. Consider slicing the input dataset along organ systems: solving a lung problem, a heart problem, a liver problem, and so on.

Recall that the business problem is that U.S. hospitals are financially incented to avoid early discharge of patients who may soon be re-admitted for the same illness. So you may wish to focus your analysis on rapid re-admits.

You didn't mention the timeframe for your observed examples. If it spans decades, you may be able to contrast hospital discharge behavior before and after readmission incentives went into effect.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.