Rmd块中的RWeka M5P模型树给出错误

时间:2018-07-26 10:16:20

标签: r rweka

我使用以下命令创建模型树:

Tree_Model <- RWeka::M5P(Formule_Train, data = AB_Train)

然后,以下行在Rmd文件中的R块内正常运行:

Tree_Model_Test <- predict(Tree_Model, newdata=AB_Test)

但是当我尝试编织文档时,出现此错误:

Error in .jcall(o, "Ljava/lang/Class;", "getClass") : 
  RcallMethod: attempt to call a method of a NULL object.
Calls: <Anonymous> ... .predictions_for_instances -> .has_method -> .jcall

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

换行后

Tree_Model <- RWeka::M5P(Formule_Train, data = AB_Train)

library(RWeka)
Tree_Model <- M5P(Formule_Train, data = AB_Train)

编织者不再抱怨

7分钟后,我得到了与以前相同的错误:-(