Survival Analysis, Data Science, Analytics.
Initialize CoxPHFitter cph = CoxPHFitter() # Fit the model to your data cph.fit(data, duration_col='time_to_event', event_col='event') # Print a summary of the fitted model cph.print_summary() # Plot the covariate effects (hazard ratios) cph.plot_covariate_groups('covariate', values=[-1, 0, 1])