I'm running a Cox PH model in python using lifelines
package.
The two performance measures this package offers is log-likelihood or concordance index.
I am aware the log-likelihood wouldn't be optimal to measure performance, but more to compare between two or more models.
I've also seen mixed comments regarding the C-index: some say it is the correct way to analyze predictions for survival models, others say it's not good because it basically performs a ranked correlation but it does not take into account precision.
In particular in this package I can run the command predict_median
which returns the median time to cure/survive, and inf
or a very large number if the observation should not cure. Here is an example to make it clear:
daten2 = daten.iloc[:-10]
cph = CoxPHFitter(penalizer=0.05)
cph.fit(daten2, "length_of_arrears", event_col='cured')
Out[269]: <lifelines.CoxPHFitter: fitted with 14080 total observations, 4573 right-censored observations>
d_data = daten.iloc[0:10,:]
cph.predict_median(d_data)
Out[271]:
0 612.0
1 579.0
2 104.0
3 3.0
4 4.0
5 4.0
6 4.0
7 7.0
8 9.0
9 4.0
Name: 0.5, dtype: float64
d_data.length_of_arrears
Out[272]:
0 287.0
1 196.0
2 75.0
3 3.0
4 8.0
5 3.0
6 3.0
7 72.0
8 27.0
9 3.0
Name: length_of_arrears, dtype: float64
d_data.cured
Out[273]:
0 0.0
1 0.0
2 0.0
3 1.0
4 1.0
5 1.0
6 1.0
7 1.0
8 1.0
9 1.0
Name: cured, dtype: float64
I would like to get an estimate of precision, that is, how many days off is the predicted median survival time. Is there anything like this?