relife.regression.concordance_index

relife.regression.concordance_index

relife.regression.concordance_index(time: numpy.ndarray, event: numpy.ndarray, score: numpy.ndarray, include_tied_score: bool = True) Tuple[float, int, int, int][source]

Computes the concordance index (c-index).

The concordance index is a metric for evaluating the predictions of a survival regression model. It is the proportion of concordant pairs divided by the total number of possible evaluation pairs.

Parameters
  • time (1D array) – Array of time-to-event or durations.

  • event (1D array) –

    Array of event types coded as follows:

    • 0 if observation ends before the event has occurred (right censoring)

    • 1 if the event has occured

  • score (1D array) – Vector of individual risk scores (e.g. the median).

  • include_tied_score (bool, optional) – Specifies whether ties in risk score are included in calculations, by default True.

Returns

  • cindex : The computed concordance index (float)

  • concordant : Number of concordant pairs (int)

  • discordant : Number of discordant pairs (int)

  • tied_score : Number of pairs having tied estimated risks (int)

Return type

Tuple[float, int, int, int]