evidation-health / ContinuousTimeMarkovModel

Continuous-time Markov model with discrete observations
MIT License
23 stars 23 forks source link

ContinuousTimeMarkovModel

Implements the model described in the paper

Unsupervised Learning of Disease Progression Models (X. Wang, D. Sontag, F. Wang), KDD'14

http://cs.nyu.edu/~dsontag/papers/WanSonWan_kdd14.pdf

Instructions

pip install --process-dependency-links --trusted-host github.com -e git+https://github.com/evidation-health/ContinuousTimeMarkovModel.git#egg=ContinuousTimeMarkovModel

python claimsToInputs.py mydata.csv -c 32 -o myPickledInputs

mydata.csv should contain rows of index, userid, datetime, claimsCode(i.e. ICD9) with a header pers_uniq_id, date_of_service, primary_diag_cd but the script can be easily modified to fit slightly different formatting

run runSontagModel.py -n 1001 -t 100 -d '../data/myPickledInputs'

pymc3.traceplot(trace=trace,vars=['pi']); plt.show()
groundTruthTraceplot(L_start,trace,var='L')