I have a predictive model trained in R on a large dataset. Now I need to export that trained model so that I can use it for future prediction/scoring of new cases. I am unsure what are the best ways to do so. I have seen that there is something called PMML which could be used for exporting some models, but it requires both that the exact model is supported by the PMML package + I need a parser to apply the PMML in whatever language my web service is written in. Are the better/more modern ways of doing this?
I have read about approaches where the trained model is saved as and .rds file which can then be loaded into an R-deamon process and poked at using HTTP via e.g. plumber - but I wonder if that is really a production scale solution?
Convert your R model to PMML document using the
r2pmmlpackage, and then deploy this PMML document as an HTTP endpoint using the Openscoring REST web service.If your R model type is supported, then the whole process takes <1 min from the get-go, and is technically very solid/modern/competitive. If your R model type is not yet supported, then please open a feature request with the
r2pmmlproject's issue tracker to make it happen.