It seems that there is no conditional prediction for the survival function when using PiecewiseExponentialRegressionFitter, is there any workaround using the regular prediction, ie conditional_after=None?
Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_9104/2486616508.py in <module>
1 censored_subjects_last_obs = test['subscription_age']
----> 2 surv=model.predict_survival_function(test, conditional_after=censored_subjects_last_obs)
~\anaconda3\envs\retention\lib\site-packages\lifelines\fitters\__init__.py in predict_survival_function(self, df, times, conditional_after)
2287 the survival probabilities of individuals over the timeline
2288 """
-> 2289 return np.exp(-self.predict_cumulative_hazard(df, times=times, conditional_after=conditional_after))
2290
2291 def predict_median(self, df, *, conditional_after=None) -> pd.DataFrame:
~\anaconda3\envs\retention\lib\site-packages\lifelines\fitters\piecewise_exponential_regression_fitter.py in predict_cumulative_hazard(self, df, times, conditional_after)
114
115 if conditional_after is not None:
--> 116 raise NotImplementedError()
117
118 times = np.atleast_1d(coalesce(times, self.timeline)).astype(float)
NotImplementedError:
It seems that there is no conditional prediction for the survival function when using PiecewiseExponentialRegressionFitter, is there any workaround using the regular prediction, ie conditional_after=None?