square / pysurvival

Open source package for Survival Analysis modeling
https://www.pysurvival.io/
Apache License 2.0
350 stars 106 forks source link

Non-determinism in model estimation #17

Open roehst opened 4 years ago

roehst commented 4 years ago

Hi, for the MLTR and RandomSurvivalForest I get different estimates for survival probabilities on each run.

Is there any parameter to regulate training?

bacalfa commented 4 years ago

I looked into it, made some code changes, and was able to get reproducible results within the same run (multiple calls to MLTR fit in the same script). But every time I run the script, I get another set of results. I believe it's related to PyTorch (https://github.com/pytorch/pytorch/issues/7068), but even setting the seed in different places, I still can't get reproducible results in every run.

See this commit: https://github.com/square/pysurvival/commit/a3b1d0d038a932469a08424675d8e1c640526b5b