R/getAUC.R

Defines functions getAUC

#' @importFrom survival concordance
getAUC <- function(y, prob, weights = rep(1,nrow(y))) {
  Weights <- as.vector(weights * y)
  ny <- nrow(y)
  Y <- rep(c(0, 1), each = ny)
  Prob <- c(prob, prob)

  return(survival::concordance(Y ~ Prob, weights = Weights)$concordance)
}

Try the cvwrapr package in your browser

Any scripts or data that you put into this service are public.

cvwrapr documentation built on June 11, 2021, 5:21 p.m.