Python csv文件中的RoC曲线

Python csv文件中的RoC曲线,python,machine-learning,scikit-learn,roc,Python,Machine Learning,Scikit Learn,Roc,如何使用scikit learn或任何其他python库为csv文件绘制roc曲线,例如: 1, 0.202 0, 0.203 0, 0.266 1, 0.264 0, 0.261 0, 0.291 ....... 这不是python的答案,但是如果你使用R(),它就像 # load data X <- read.table("mydata.csv", sep = ",") # create and plot RoC curve library(ROCR) roc <- ROCR

如何使用scikit learn或任何其他python库为csv文件绘制roc曲线,例如:

1, 0.202
0, 0.203
0, 0.266
1, 0.264
0, 0.261
0, 0.291
.......

这不是python的答案,但是如果你使用
R
(),它就像

# load data
X <- read.table("mydata.csv", sep = ",")

# create and plot RoC curve
library(ROCR)
roc <- ROCR::performance(ROCR::prediction(X[,2], X[,1]), "tpr", "fpr")
plot(roc)
#加载数据

谢谢。但是我得到了这个错误
predict不是从名称空间导出的对象:ROCR
这是一个输入错误,很抱歉(现在无法测试代码)。它应该是
RORC::prediction
而不是
ROCR::predict
# load data
X <- read.table("mydata.csv", sep = ",")

# create and plot RoC curve
library(ROCR)
roc <- ROCR::performance(ROCR::prediction(X[,2], X[,1]), "tpr", "fpr")
plot(roc)