Predictions using CoxTimeVaryingFitter for survival analysis in Python For a customer churn analysis , i am building a time varying cox model in Python (available under lifelines package) to predict survival probabilities. The model object CoxTimeVaryingFitter() currently does not support or include functions to predict survival probability directly.
On the contrary, they have baseline_cumulative_hazard_ that shows baselime cumulative hazard across tenure and predict_partial_hazard() to predict partial hazard rate $\exp\{(\mathbf{x}−\overline{\mathbf{x}})^T\mathbf{β}\}$.
Can anyone advise me on how i can use these two outputs from model object to calculate survival rate for all the customers.
Does this the below approach makes sense?
$$S(t) = \{\exp(-H(t))\}^{exp(\mathbf{\beta}^T\mathbf{x})}$$
where $H(t)$ = baseline cumulative hazard
and   $\mathbf{\beta}$ = coefficient
and   $\mathbf{x}$ = co variate
If so , does this mean , i have to compute survival rate for all customers across each tenures based on baseline and covariate value?
Thanks
Reference:
https://lifelines.readthedocs.io/en/latest/fitters/regression/CoxTimeVaryingFitter.html?highlight=predict_partial_hazard#lifelines.fitters.cox_time_varying_fitter.CoxTimeVaryingFitter.predict_partial_hazard
 A: Simply put: you can't predict for epistemological reasons. Why is that? To predict, you must have time-varying $X$, that is, $X(t)$. But, if you have $X(t)$, then you must be making measurements on a customer, so they are not dead! Therefore, the fact that you have or don't have $X(t)$ tells you if the customer is alive or not, making any "survival" prediction moot.
A: I generally agree with the sentiment voiced in the answer from @Cam.Davidson.Pilon (which I upvoted). It's too easy to introduce survivorship bias that way.
Nevertheless, there are circumstances in which it can make sense to use time-varying covariates for predictions from Cox models. Therneau and Grambsch, in "Modeling Survival Data: Extending the Cox Model" (Springer, 2000), show how to do so with the survival package (S-Plus/R) in Section 10.2.4, then discuss (pages 271-2):

Some authors have argued that although a hazard function may be mathematically defined for a model such as the one above [with time-varying covariates], that "this hazard bears no relationship to a survivor function"... We tend to disagree, and could imagine some hypothetical "cohort" of subjects who follow a given path, losing members to death along the way.

This seems safe when the time-varying covariate is predictable and could be defined even if an event had occurred (e.g., a non-linear effect of age, a time-transformed baseline covariate to deal with non-proportional hazards). Therneau and Grambsch do go on to warn:

Examples where the covariate path is guaranteed are the exception, however. A major concern ... is whether the hypothetical path represents any patient at all. Survival curves based on a time-dependent covariate must be used with extreme caution.

