我正在跟踪德国信用数据的分析,我收到了一个错误,我无法纠正,因为我已经安装了 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"
答案 0 :(得分:2)
我有同样的问题......如果你仔细观察,它会说:
Loading required package: gplots
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘KernSmooth’
In addition: Warning messages:
1: package ‘ROCR’ was built under R version 3.0.3
2: package ‘gplots’ was built under R version 3.0.3
Error: package ‘gplots’ could not be loaded
我只是安装了install.packages(&#34; gplots&#34;),然后加载了库并加载它,发现函数没有任何问题。
希望这有帮助
答案 1 :(得分:1)
我也有同样的问题,尽管已经有了#34; gplots&#34;安装并且显然是最新的,我只是通过命令install.packages(&#34; gplots&#34;)重新安装它,它似乎工作正常。