Giter Club home page Giter Club logo

Comments (4)

havakv avatar havakv commented on July 21, 2024

Hi! There isn't an option to get that directly for DeepSurv here, but if use model.predict_surv_df (like in this notebook) you get predictions in the form of a data frame where the index represents the time. To get predictions for a given point in time, you just have to look at that index. Remember that the survival prediction of DeepSurv are a step function, so to get the survival prediction for time_t, you need something like

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?

from pycox.

gunesevitan avatar gunesevitan commented on July 21, 2024

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 surv_df, then I used linear interpolation for missing rows. The results were acceptable.

from pycox.

havakv avatar havakv commented on July 21, 2024

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.

from pycox.

gunesevitan avatar gunesevitan commented on July 21, 2024

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.

from pycox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.