square / pysurvival

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

Time bucket error after fitting coxph #9

Open FSNStefan opened 5 years ago

FSNStefan commented 5 years ago

I tried to fit CoxPHModel with my own dataset. I am sure that the format for X, T, and E vectors are correct. However, I got "AttributeError: The time axis needs to be created before using the method get_time_buckets." after optimization reached max number of iterations. How can I solve this problem?

diego-s commented 4 years ago

I had the same issue. Somehow it seemed to be due to a mistake of mine, I had passed time and censoring arrays that were only one item long. For this, the code could be potentially improved by checking the consistency of all input array dimensions. I hope this helps.