-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Predict survival probabilities at given times #58
Comments
Hi! There isn't an option to get that directly for DeepSurv here, but if use surv = model.predict_surv_df(x_test)
preds = surv[surv.index <= time_t].iloc[-1] Does this makes sense, or do you want a more detailed explanation? |
Yeah, it makes perfect sense, but I needed the exact probabilities of the given timesteps because I was trying evaluate my results with AUC metric. I solved it by adding new timesteps as index to |
That should probably work fine. The downside of Cox model is that it only provides estimates at the event times used in the training set (so the hazard is zero between these event times). While the Cox partial likelihood was really genius for other statistical purposes than prediction, it is not obvious how to best do prediction between the event times of the training set. |
I see, that makes more sense now. Since the hazard is zero between event times, it is not possible to calculate survival probabilities directly. There are several workarounds to do it like linear interpolation and regression, but they are probably on the outside of this package's scope. |
Hi, I'm trying to predict survival probabilities of a population at 6, 12 and 24 months.
lifelines.CoxPHFitter
has that functionality. I am able to specify atimes
parameter for predict survival function. I wonder if it is also possible with DeepSurv model. If not, how can I achieve similar results?The text was updated successfully, but these errors were encountered: