Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROC AUC for a binary classification problem #17

Closed
hbaniecki opened this issue Nov 10, 2022 · 0 comments · Fixed by #19
Closed

ROC AUC for a binary classification problem #17

hbaniecki opened this issue Nov 10, 2022 · 0 comments · Fixed by #19
Labels
bug 💣 Bug to fix

Comments

@hbaniecki
Copy link
Member

It should take into account censoring and the target based on times.

else {
if (is.null(times)) stop("Times cannot be NULL for type `roc`")
rocs <- lapply(times, function(time) {
labels <- 1 - explainer$y[, 2]
scores <- explainer$predict_survival_function(explainer$model, newdata, time)
labels <- labels[order(scores, decreasing = TRUE)]
cbind(time = time, data.frame(TPR = cumsum(labels) / sum(labels), FPR = cumsum(!labels) / sum(!labels), labels))
})
rocs_df <- do.call(rbind, rocs)
class(rocs_df) <- c("surv_model_performance_rocs", class(rocs_df))
attr(rocs_df, "label") <- explainer$label
rocs_df
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💣 Bug to fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant