我正在对德国信用数据进行分析,但由于我已经安装了ROCR软件包,我遇到了一个错误,我无法纠正该错误。下面是使用ROCR的代码:
#load library
library(ROCR)
#score test data set
test$score <- predict(m,type='response',test)
pred <- prediction(test$score,test$good_bad)
perf <- performance(pred,"tpr","fpr")
plot(perf)
现在,运行后pred
,我收到以下错误:
>pred <- prediction(test$score,test$Good_Bad)
Error: could not find function "prediction".
当我尝试执行以下行时也会发生这种情况:
>perf <- performance(pred,"tpr","fpr")
Error: could not find function "performance"