1

I have a model trained and stored in a file called "rpartModel.RData", in my R script to use this model in DeployR, I need to load the model every time the script is called. There is any way to load the file only once and the variable be used in the R scripts?

My code:

library(caret)
load("rpartModel.RData") #no way to run just once and be used as global?
predict(fitRPart,kyphosis[10,])
Andrie
  • 176,377
  • 47
  • 447
  • 496

1 Answers1

1

Found it.

Using the RBroker I can espcify a file to be preloaded, like in this java example https://github.com/deployr/java-example-fraud-score/blob/master/src/main/java/com/revo/deployr/rbroker/example/service/FraudService.java .

PoolPreloadOptions preloadOptions = new PoolPreloadOptions();
preloadOptions.filename = "rpartModel.rData";