loss_one_minus_c_index {survex} | R Documentation |
Calculate the Concordance index loss
Description
This function subtracts the C-index metric from one to obtain a loss function whose lower values indicate better model performance (useful for permutational feature importance)
Usage
loss_one_minus_c_index(y_true = NULL, risk = NULL, surv = NULL, times = NULL)
Arguments
y_true |
a |
risk |
a numeric vector of risk scores corresponding to each observation |
surv |
ignored, left for compatibility with other metrics |
times |
ignored, left for compatibility with other metrics |
Value
numeric from 0 to 1, lower values indicate better performance
References
[1] Harrell, F.E., Jr., et al. "Regression modelling strategies for improved prognostic prediction." Statistics in Medicine 3.2 (1984): 143-152.
See Also
Examples
library(survival)
library(survex)
rotterdam <- survival::rotterdam
rotterdam$year <- NULL
cox_rotterdam_rec <- coxph(Surv(rtime, recur) ~ .,
data = rotterdam,
model = TRUE, x = TRUE, y = TRUE
)
coxph_explainer <- explain(cox_rotterdam_rec)
risk <- coxph_explainer$predict_function(coxph_explainer$model, coxph_explainer$data)
loss_one_minus_c_index(y_true = coxph_explainer$y, risk = risk)
[Package survex version 1.2.0 Index]