autonlab / auton-survival

Auton Survival - an open source package for Regression, Counterfactual Estimation, Evaluation and Phenotyping with Censored Time-to-Events
http://autonlab.github.io/auton-survival
MIT License
315 stars 74 forks source link

Age feature in pbc2 #130

Open ayushpatnaikgit opened 10 months ago

ayushpatnaikgit commented 10 months ago

Hi, In datasets.py, are you making age a dynamic covariate, instead of just using the initial value?

In that case, https://github.com/autonlab/auton-survival/blob/5dde465f7223601717abddc1d075e837707c403b/auton_survival/datasets.py#L132

should change to

age = data['age'] + data['year']

years is the time of the event. year is the time indicator.

Here are some results:

Current:

In: x, t, e = datasets.load_dataset('PBC', sequential = True)
In: x[0][0][-1]
Out: 59.86200854232829

In: x[0][1][-1]
Out: 59.86200854232829

After the proposed change:

In: x, t, e = datasets.load_dataset('PBC', sequential = True)
In: x[0][0][-1]
Out: 58.7668382433468

In: x[0][1][-1]
Out: 59.29251998685791

I have tested this on the DeepSurvivalMachine package, but I believe this package uses the same module for loading datasets. I can redo these tests, and do a pull request if needed.

matteo4diani commented 10 months ago

Hi Ayush 👋🏼 thanks for contributing to auton-survival 🙂 If you'd like to open a PR, that would be great.