c_index {mlsurvlrnrs} | R Documentation |
Calculate the Harrell's concordance index (C-index)
c_index(ground_truth, predictions)
ground_truth |
A 'survival::Surv' object with the ground truth. |
predictions |
A vector with predictions. |
A wrapper function around [glmnet::Cindex()] for use with 'mlexperiments'.
[glmnet::Cindex()]
set.seed(123)
gt <- survival::Surv(
time = rnorm(100, 50, 15),
event = sample(0:1, 100, TRUE)
)
preds <- rbeta(100, 2, 5)
c_index(gt, preds)