View source: R/ranger_RF_util.R
get.auroc | R Documentation |
calculates the area under the ROC curve
get.auroc(predictor, y, positive_class)
predictor |
A predictor. For example, one column in the probability table, indicating the probability of a given observation being the positive class in the factor y. |
y |
A binary factor vector indicates observed values. |
positive_class |
A class of the factor y. |
The auroc value.
Shi Huang
y<-factor(c(rep("A", 31), rep("B", 29))) y1<-factor(c(rep("A", 18), rep("B", 20), rep("C", 22))) y0<-factor(rep("A", 60)) pred <- c(runif(30, 0.5, 0.9), runif(30, 0, 0.6)) prob <-data.frame(A=pred, B=1-pred) positive_class="A" get.auroc(predictor=prob[, positive_class], y, positive_class="A") get.auroc(predictor=prob[, positive_class], y, positive_class="B") get.auroc(predictor=prob[, positive_class], y0, positive_class="A") get.auroc(predictor=prob[, positive_class], y1, positive_class="A")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.