我正在尝试使用 ROCR 绘制 ROC 曲线,以评估二项式 logit 模型的拟合优度。(我的数据库名为“stat”)我通过以下方式正确获取模型:
GLM.4 <- glm(V1 ~ V10 + V11 + V13 + V14 + V15, family=binomial(logit),
data=stat)
summary(GLM.4)
exp(coef(GLM.4))
但是当我运行 ROCR 命令时:
GLM.4.pred <- prediction(GLM.4, stat, label.orderin=NULL)
perf <- performance(GLM.4.pred, "tpr", "fpr")
plot(perf)
我总是收到错误“预测和标签的交叉验证运行次数必须相等”。
有人可以帮助我理解错误吗?谢谢