calibration

lifelines.calibration.survival_probability_calibration(model: RegressionFitter, df: DataFrame, t0: float, ax=None)

Smoothed calibration curves for time-to-event models. This is analogous to calibration curves for classification models, extended to handle survival probabilities and censoring. Produces a matplotlib figure and some metrics.

We want to calibrate our model’s prediction of \(P(T < \text{t0})\) against the observed frequencies.

Parameters:
  • model – a fitted lifelines regression model to be evaluated

  • df (DataFrame) – a DataFrame - if equal to the training data, then this is an in-sample calibration. Could also be an out-of-sample dataset.

  • t0 (float) – the time to evaluate the probability of event occurring prior at.

Returns:

  • ax – mpl axes

  • ICI – mean absolute difference between predicted and observed

  • E50 – median absolute difference between predicted and observed

  • https (//onlinelibrary.wiley.com/doi/full/10.1002/sim.8570)