使用ROCR包绘制ROC曲线时出现奇怪的错误

时间:2016-04-16 08:20:50

标签: r

我尝试创建一个简单的ROC曲线,执行以下操作:

library(ROCR)
data(ROCR.simple)
pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels)
perf <- performance(pred,"tpr","fpr")
plot(perf)

然而,这给了我以下错误:

  Error in UseMethod("prop_type") : 
  no applicable method for 'prop_type' applied to an object of class "performance"

有什么想法会导致这种情况吗?

这是我的sessionInfo

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
  [1] LC_COLLATE=Dutch_Netherlands.1252  LC_CTYPE=Dutch_Netherlands.1252    LC_MONETARY=Dutch_Netherlands.1252
[4] LC_NUMERIC=C                       LC_TIME=Dutch_Netherlands.1252    

attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
  [1] ggvis_0.4.2  dplyr_0.4.3  ROCR_1.0-7   gplots_3.0.1 FNN_1.1     

loaded via a namespace (and not attached):
  [1] Rcpp_0.12.4        gtools_3.5.0       digest_0.6.9       assertthat_0.1     mime_0.4          
[6] bitops_1.0-6       R6_2.1.2           xtable_1.8-2       DBI_0.3.1          magrittr_1.5      
[11] KernSmooth_2.23-15 lazyeval_0.1.10    gdata_2.17.0       tools_3.2.3        shiny_0.13.2      
[16] httpuv_1.3.3       parallel_3.2.3     caTools_1.17.1     htmltools_0.3.5   

0 个答案:

没有答案