I have an issue with creating a ROC Curve for my decision tree created by the rpart package. My goal was to predict "y" the success of the bank's marketing campaign. In the end, you can get a "yes" or a "no" as a possible answer. How can I approach my next step the ROC curve plot?
Here is the R code I have so far:
library(caTools)
library(rpart)
library(rpart.plot)
set.seed(1234)
sample = sample.split(bank$y, SplitRatio = .75)
train = subset(bank, sample==TRUE)
test = subset(bank, sample==FALSE)
tree <-rpart(y ~.,method="class",data=train)
tree.preds<-predict(tree, test)
tree.preds<-as.data.frame(tree.preds)
joiner <- function(x) {if (x >= 0.5) {return("Yes") } else {return("No")}}
tree.preds$y <- sapply(tree.preds$yes, joiner)
table(tree.preds$y, test$y)
prp(tree)