Cox proportional hazards model lifelines runtime warning divide by zero and invalid value encountered

440 views Asked by At

I am building a Cox Proportional hazards model with the lifelines package to predict the time a borrower potentially prepays its mortgage. I fit a model by means of the cph.coxphfitter() within the liflines package. Despite the fact that the model performs decent in terms of a Concordance index, when I make a calibration plot, see screenshot, I receive the following two error messages:

C:Anaconda3\lib\site-packages\lifelines\calibration.py:45: RuntimeWarning: divide by zero encountered in log
  return np.log(-np.log(1 - p))
C:Anaconda3\lib\site-packages\lifelines\fitters\mixins.py:19: RuntimeWarning: invalid value encountered in subtract
  return self.relu(x - knot) ** 3 - (lambda_ * self.relu(x - min_knot) ** 3 + (1 - lambda_) * self.relu(x - max_knot) ** 3)

In which column of the dataset could these problems occur? Is it the duration column, the event column, or one of the covariates? And if so, how could I solve them? Thank you in advance!

Calibration plot

T=140 calibration plot: calibration plot at t=140

0

There are 0 answers