[R] How to save/load RWeka models into/from a file?
Paulo Cortez
pcortez at dsi.uminho.pt
Thu Oct 16 19:17:05 CEST 2008
Hi,
I want to save a RWeka model into a file, in order to retrive it latter
with a load function.
See this example:
library(RWeka)
NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayes")
model<-NB(formula,data=data,...) # does not run but you get the idea
save(model,file="model.dat") # simple save R command
# ...
load("model.dat") # load the model from the previously saved file...
model # should work but I get instead this error:
Error in .jcall(x$classifier, "S", "toString") :
RcallMethod: attempt to call a method of a NULL object.
What is wrong and how can I solve this problem?
Regards,
--
Paulo Alexandre Ribeiro Cortez (PhD, MSc)
Lecturer (Prof. Auxiliar) at the Department of Information Systems (DSI)
University of Minho, Campus de AzurÈm, 4800-058 Guimaraes, Portugal
http://www.dsi.uminho.pt/~pcortez +351253510313 Fax:+351253510300
More information about the R-help
mailing list