Giter Site home page Giter Site logo

Comments (5)

dareneiri avatar dareneiri commented on August 23, 2024 1

Hi @jaredleekatzman, let me know if you have any new thoughts on my second question regarding the range of the risk values and whether they should be between 0-1 (I see -5 to 5 from my normalized dataset). Much appreciated!

from deepsurv.

jaredleekatzman avatar jaredleekatzman commented on August 23, 2024

@dareneiri
When calculating the concordance index, the absolute event times are not necessary because the CI is calculated by comparing relative event times.
DeepSurv isn't predicting the event time for events, but the risk (effect of covariates on the hazard). We assume that an observation with a higher risk will cause an event to happen sooner. So, we take DeepSurv's predictions on a dataset as the reverse ranking (hence the negative sign) of event times.
This allows us to use the variable partial_hazardsin the place of predicted_event_timesin the lifelines package.

In our model, the network can predict negative risk because we take the exponent of the risk function. This transforms the values to be positive, which satisfies the constraint of the hazard function as positive.

from deepsurv.

dareneiri avatar dareneiri commented on August 23, 2024

@jaredleekatzman
Thank you for taking the time explain more in detail how DeepSurv works.
Could you provide more detail on what the expected range should be for these risk values? For me, this seems to be related to the size of my dataset and the set.seed() value, but I typically see a range of risk values from -5 to 5.

I obtain these values by running DeepSurv with the following changes in deep_surv.py near lines 163:

from theano import printing
risk = self.risk(deterministic)
risk_printed = theano.printing.Print('This is risk\n')(risk)
hazard_ratio = T.exp(risk_printed)

I collected these calculated risk values from Theano and created a historgram to see the spread.

I'm not looking at the hazard_ratio (relative risk), but the risk value itself. Shouldn't the risk values be between 0-1 (probability)?

Appreciate your time in providing a response!

Note that my concordance index is around 0.83 when these risk values result.

from deepsurv.

hanxiaozhen2017 avatar hanxiaozhen2017 commented on August 23, 2024

Hi @dareneiri ,
I saw you are very professional with deepsurv. Would you mind me ask you some questions about deepsurv? Now I can import deepsurv using pycharm but do I need to use docker in order to train my own model using my train data? If so, can you give some example code for begin? I am a beginner for this and many thanks for your reply in advance!

from deepsurv.

bnuzyc91 avatar bnuzyc91 commented on August 23, 2024

I have the same question regarding the range of the risk values
I am using below code after the model is trained
get_risk=model.predict_risk(train_data["x"])
print(get_risk)

for the metabric dataset, the range of this get_risk is (-0.016, 0.066)

for my own dataset (N quite large and rare event with event rate ~1% ), the range of this get_risk is
(-32.398220, 151.645113)

Much appreciated!!!

from deepsurv.

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.