jaredleekatzman / DeepSurv

DeepSurv is a deep learning approach to survival analysis.
MIT License
566 stars 166 forks source link

Negative log likelihood equation #40

Closed jmigual closed 1 year ago

jmigual commented 6 years ago

Hello,

I've read your paper and when looking for the negative log likelihood equation and implementation it looks like they are not the same. In the paper there's equation 3 which is like this:

But looking at the code it seems that you are not using the risk set (R(t)) and it behaves like this (notice the absence of R(Ti) in the second summation):

Is there a reason for this?

jaredleekatzman commented 6 years ago

Hi Joan,

Thank you checking the code. The code should be calculating the correct negative log likelihood (the first equation). The training data is preprocessed to be sorted in reverse order of death (line 328 https://github.com/jaredleekatzman/DeepSurv/blob/master/deepsurv/deep_surv.py#L328). Therefore, when you look at line 164 https://github.com/jaredleekatzman/DeepSurv/blob/master/deepsurv/deep_surv.py#L164, when we are taking the cumulative sum down the matrix, it is accumulating the sum of the e^h(x) for each individual’s risk set.

Le me know if you have any more questions!

Jared

On Mar 16, 2018, at 3:46 PM, Joan notifications@github.com wrote:

Hello,

I've read your paper and when looking for the negative log likelihood equation and implementation it looks like they are not the same. In the paper there's equation 3 which is like this:

https://user-images.githubusercontent.com/6493651/37540797-acdbbc7e-292e-11e8-9f21-d102dd559125.png But looking at the code it seems that you are not using the risk set (R(t)) and it behaves like this (notice the absence of R(Ti) in the second summation):

https://user-images.githubusercontent.com/6493651/37540986-57c77ae2-292f-11e8-80e5-6c586c94642e.png Is there a reason for this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jaredleekatzman/DeepSurv/issues/40, or mute the thread https://github.com/notifications/unsubscribe-auth/AFmmZoaayQE2a0WNyJiC-wVEVQ-Cb-Rrks5tfBaJgaJpZM4SuV84.

ml-and-ml commented 5 years ago

why is the reasoning to go in reverse order of death?