library(ggplot2)
library(pROC)
# mROC is a ROC object
myauc <- paste("AUC=",round(auc(mROC), digits=2), sep='')
p <- ggroc(mROC) + annotate(geom="text", x=0.8, y=0.85, label=myauc) +
theme(panel.grid.major = element_line(color = '#e0e0e0', size=0.2),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(colour = "black")
)
library(ggplot2)
library(pROC)
# svmROC, gbmROC, rfROC: ROC object
ggroc(list(svm=svmROC, gbm=gbmROC, randomForest=rfROC)) +
theme_bw() +
theme(legend.title = element_blank(),
legend.position = c(0.8, 0.2),
legend.text = element_text(size=12),
text = element_text(size=12)) +
scale_color_manual(values=c("#000000", "#0072B2", "#E69F00", "#CC79A7"),
labels=c(paste("gbm: ", round(gbmROC$auc,4), sep=""),
paste("randomForest: ", round(rfROC$auc, 4), sep=""),
paste("svm: ", round(svmROC$auc, 4), spe=""),
paste("nnet: ", round(nnetROC$auc, 4), sep="")
)
) +
labs(title="", x="Specificity", y="Sensitivity")