# assess performance =========================================
#' Evaluate classifier performance using AUC
#' @param y labels
#' @param prob predictions
#' @param at index of where the assessment should be performed
#' @param rm_diag remove diagonal?
#' @export
get_auc = function(y, prob, at = NULL, rm_diag = FALSE) {
y = as.matrix(y)
prob = as.matrix(prob)
if ( !is.null(at) ) {
y = y[at]
prob = prob[at]
}
if ( isTRUE(rm_diag) ) {
y = vec_no_diag(y)
prob = vec_no_diag(prob)
} else {
y = vec(y)
prob = vec(prob)
}
glmnet::auc(y, prob)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.