1

I'm trying to plot the ROC with AUR in R using the package pROC. The plot is good for now (maybe) but I'm trying also to obtain the best threshold value from this plot. I'm getting a negative value and I don't know why, if someone can help me I'll be vary thankful.

The code for now is

install.packages("pROC")
library(pROC)
pre <- predict(QualityLog,qualityTrain)
modelroc <- roc(qualityTrain$PoorCare,pre)
plot(modelroc,
     print.auc = TRUE,
     auc.polygon = TRUE,
     max.auc.polygon = TRUE,
     legacy.axes = TRUE,
     auc.polygon.col = "skyblue",
     print.thres = "best",
     print.auc.x = 0.4,
     print.auc.y = 0.2)
dev.off()
coord <- coords(modelroc, "best", input="threshold", ret = "threshold")

where QualityLog is my logistic model and the qualityTrain is the data that I'm working with.

The plot for now is this: ROC

Nemo13
  • 11
  • 1
  • Why? Probably because the best threshold value is a negative value. You'll need to include your data if you want more details, see https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for options how to do it. – Calimo Nov 07 '21 at 07:31

0 Answers0