I'm coming up with an error after loading a saved M5 implementation of the RWeka package via Caret.
Error in .jcall(o, "Ljava/lang/Class;", "getClass") :
RcallMethod: attempt to call a method of a NULL object.
To reproduce the error:
library(caret); library(RWeka)
data(GermanCredit)
myModel <- train(Duration~Amount, data=GermanCredit, method="M5")
predict(myModel, GermanCredit[1,]) # Works.
save(myModel, file="myModel.rda")
load("myModel.rda")
predict(myModel, GermanCredit[1,]) # Produces the RcallMethod error.
This post indicates that RWeka objects are references to a Java object, and that object must be serialized in order to save/load properly.
However, I cannot find the right commands to extend this to the Caret package implementation.