sksurv.metrics.concordance_index_censored#
- sksurv.metrics.concordance_index_censored(event_indicator, event_time, estimate, tied_tol=1e-08)[source]#
Measures the agreement between a predicted risk score and the actual time-to-event.
The concordance index is a measure of rank correlation between predicted risk scores and observed time points. It is defined as the proportion of all comparable pairs in which the predictions and outcomes are concordant. A pair of samples is concordant if the sample with a higher risk score has a shorter time-to-event. A higher concordance index indicates better model performance.
A pair of samples is considered comparable if the sample with a shorter survival time experienced an event. This means we can confidently say that the individual with the shorter time had a worse outcome. If both samples are censored, or if they experienced an event at the same time, they are not comparable.
When predicted risks are identical for a pair, 0.5 rather than 1 is added to the count of concordant pairs.
See the User Guide and [1] for further description.
- Parameters:
event_indicator (array-like, shape = (n_samples,)) – A boolean array where
Trueindicates an event andFalseindicates censoring.event_time (array-like, shape = (n_samples,)) – Array containing the time of an event or time of censoring.
estimate (array-like, shape = (n_samples,)) – The predicted risk score for each sample (e.g., from
estimator.predict(X)). A higher value indicates a higher risk of experiencing an event.tied_tol (float, optional, default: 1e-8) – The tolerance value for considering ties in risk scores. If the absolute difference between two risk scores is smaller than or equal to
tied_tol, they are considered tied.
- Returns:
cindex (float) – The concordance index.
concordant (int) – The number of concordant pairs.
discordant (int) – The number of discordant pairs.
tied_risk (int) – The number of pairs with tied risk scores.
tied_time (int) – The number of comparable pairs with tied survival times.
Notes
This metric expects risk scores, which are typically returned by
estimator.predict(X). It does not accept survival probabilities.See also
concordance_index_ipcwA less biased estimator of the concordance index.
References