loss_one_minus_cd_auc | R Documentation |
This function subtracts the C/D AUC metric from one to obtain a loss function whose lower values indicate better model performance (useful for permutational feature importance)
loss_one_minus_cd_auc(y_true = NULL, risk = NULL, surv = NULL, times = NULL)
y_true |
a |
risk |
ignored, left for compatibility with other metrics |
surv |
a matrix containing the predicted survival functions for the considered observations, each row represents a single observation, whereas each column one time point |
times |
a vector of time points at which the survival function was evaluated |
a numeric vector of length equal to the length of the times vector, each value (from the range from 0 to 1) represents 1 - AUC metric at a specific time point, with lower values indicating better performance.
#' @section References:
[1] Uno, Hajime, et al. "Evaluating prediction rules for t-year survivors with censored regression models." Journal of the American Statistical Association 102.478 (2007): 527-537.
[2] Hung, Hung, and Chin‐Tsang Chiang. "Optimal composite markers for time‐dependent receiver operating characteristic curves with censored survival data." Scandinavian Journal of Statistics 37.4 (2010): 664-679.
cd_auc()
library(survival)
library(survex)
cph <- coxph(Surv(time, status) ~ ., data = veteran, model = TRUE, x = TRUE, y = TRUE)
cph_exp <- explain(cph)
y <- cph_exp$y
times <- cph_exp$times
surv <- cph_exp$predict_survival_function(cph, cph_exp$data, times)
loss_one_minus_cd_auc(y, surv = surv, times = times)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.