2

I have been using the mallet package in R that wraps MALLET. So far so good, but I was wondering how I can save and load th model state on the disk, so that I don't have to train all over and get a different model each time.

For the saving part it seems that model$writeState() does the trick, although this function is a bit undocumented. The complete code for saving the model state would be something like

model <- trainLDA(mallet.instances, 30)
model$writeState('model.state.gz')

Loading still remains a mystery to me. Perhaps calling a method from the base class ParallelTopicModel but don't really now how to do it in rJava

Yannis P.
  • 2,745
  • 1
  • 24
  • 39

0 Answers0