hazardous.metrics.aj_calibration#
- hazardous.metrics.aj_calibration(y_calibration, times, pred_calibration, alpha=2, reduction='mean', min_prop_at_risk=0.05)#
Overall AJ calibration score aggregated across all events.
Computes the per-event AJ calibration scores via
aj_calibration_per_event(), then reduces them to a single number:\[\text{AJ-Cal} = \frac{1}{K} \sum_{k=1}^{K} \text{AJ-Cal}_k \quad \text{(reduction='mean')}\]or the sum (resp. max) when
reduction='sum'(resp.reduction='max').Each per-event score integrates the pointwise error \(AJ_k(t) = |\bar{F}_k(t) - \hat{F}^{AJ}_k(t)|\) between the mean predicted cumulative incidence \(\bar{F}_k(t) = \frac{1}{n} \sum_{i=1}^n \hat{F}_k(t \mid \mathbf{x}_i)\) across the calibration set and the marginal Aalen-Johansen reference \(\hat{F}^{AJ}_k(t)\) fitted on the same set (Kaplan-Meier via
km_calibration()for event 0).- Parameters:
- y_calibrationarray-like of shape (n_samples, 2)
Survival outcomes of the calibration set, with columns
"event"and"duration".- timesarray-like of shape (n_times,)
Time points at which the CIFs were predicted.
- pred_calibrationarray-like of shape (n_samples, n_events+1, n_times)
Predicted incidence probabilities at
timesfor the calibration set.- alphaint, default=2
Exponent applied to the pointwise difference before integration.
- reduction{“mean”, “sum”, “max”}, default=”mean”
How to aggregate per-event scores into a single value.
- min_prop_at_riskfloat, default=0.05
Lower bound on the proportion of the set still at risk required to include a timepoint in the integral. Stops the integration once fewer than this fraction of subjects remain at risk. Set to
0to integrate over the full time grid.
- Returns:
- scorefloat
Aggregated AJ calibration score.
See also
aj_calibration_per_eventPer-event scores before aggregation.
aj_calibration_at_tPointwise calibration error at each time point.
km_calibrationKM-Calibration for single-event survival.
References
[Alberge2026]J. Alberge, T. Haugomat, G.Varoquaux,J. Abecassis, “On the calibration of survival models with competing risks”, AISTATS 2026. <https://arxiv.org/pdf/2602.00194>