是否可以通过多种预测将升力曲线绘制为ROC曲线?

问题描述

我已经用多个预测绘制了ROC,但是我找不到如何在当前图形中实现AUC的功能

我正在尝试将AUC添加到情节中,但是还没有发现任何有用的方法来确保将AUC纳入考虑范围。此外,如果有一种方法可以在图表上显示分类器的图例,那么会很棒。

library("readxl")
library(pROC)
library(ROCR)
library(randomforest)
library(caret)
library(e1071)
library(readr)
library(ggplot2)
library(DMwR)
library("ggpubr")
library("funModeling")
options(scipen = 999)
library(funModeling)

#import data
customer_offer<- read_excel("/Applications/R Practice/mydata/R_Post_Module.xlsx")

#convert to dataframe
customer_offer_data<- data.frame(customer_offer)

class_prediction1<-
  ifelse(customer_offer_data$Predicted > 0.5,1,0
  )

class_prediction2<-
  ifelse(customer_offer_data$Predicted > 0.05,0
  )

preds <- cbind(p1 = class_prediction1,p2 = abs(class_prediction2 + 
                          rnorm(length(customer_offer_data$Predicted),0.1)))

pred.mat <- prediction(preds,labels = matrix(customer_offer_data$Actual,nrow = length(customer_offer_data$Actual),ncol = 2) )

perf.mat <- performance(pred.mat,"tpr","fpr")
plot(perf.mat,colorize=TRUE) 

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)