Repository navigation
Replies: 1 comment
|
The missing step is accounting for how long each row has already survived. T and E describe the observed outcome: T is the follow-up duration, and E indicates whether the event occurred. They aren’t predictive features. With only those columns, the model gives everyone the same unconditional survival curve. But the row with T = 81 and E = 0 has already survived to time 81. Its future prediction should therefore be conditional on reaching 81: probability of surviving to time 86, given survival to 81 = S(86) / S(81). Using the values in the question, that’s 0.162931 / 0.450302 ≈ 36.2%. In lifelines, use predict_survival_function with conditional_after set to each censored row’s T value. The resulting time axis measures additional time from that row’s last observation. Five more time units means total time 86 for the row observed through 81, but total time 58 for the row observed through 53. Remaining-life predictions can differ because the rows have survived different lengths of time. To distinguish their predictions at the same starting point, additional predictive features are needed. E = 0 means the event wasn’t observed by T, not that it will never happen. With just seven observations, predictions, especially beyond the observed follow-up, are uncertain. Documentation: https://lifelines.readthedocs.io/en/latest/Survival%20Regression.html#prediction-on-censored-subjects |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm just getting started with Lifelines and survival analysis so this may be a basic question.
I'm trying to run the survival function for individual rows in my data to see how long each row will "survive".
Suppose I have this dataset of durations (T) and events(E).
Then I run these commands (after the customary initialization).
X = regression_dataset.loc[1]
ax = wft.predict_survival_function(X)
ax
...and get output like this:
53.0 0.997631
64.0 0.968971
76.0 0.716824
78.0 0.621617
81.0 0.450302
85.0 0.213209
86.0 0.162931
However, loc[1] has a T value of 81. Thus, wouldn't loc[1] have a 100 percent chance of "surviving" to 53, 64, 76 (since it already did)?
I tried a few different rows for my X values and seem to get the same output for every row. However, I'm expecting to get different outputs for my rows that are "survivors" (that is, loc[1] and loc[6]) since they have much different T values.
All reactions