R/plotroccurve.R

Defines functions plot.roc.curve

Documented in plot.roc.curve

#' plot.roc.curve
#'
#' @description: auxilia curva roc
#' @param predict
#' @param text
#'
#' @return
#' @export
#'
#' @examples
#'
#'
plot.roc.curve <- function(predictions, title.text){
  perf <- performance(predictions, "tpr", "fpr")
  plot(perf, col = "black", lty = 1, lwd = 2,
       main = title.text, cex.main = 0.6,
       cex.lab = 0.8, xaxs="i", yaxs="i")
  abline(0,1, col = "red")
  auc <- performance(predictions, "auc")
  auc <- unlist(slot(auc, "y.values"))
  auc <- round(auc,2)
  legend(0.4,0.4, legend = c(paste0("AUC: ",auc)), cex = 0.6, bty = "n", box.col = "white")

}
ViniciusJacobs/analisecredito documentation built on Sept. 12, 2020, 11:36 a.m.