PMML makes sense if you want to deploy your model directly to a PMML scoring engine such as JPMML.
Otherwise, use generic serialization mechanisms. R lets you store and load data structures using built-in functions saveRDS()
and readRDS()
, respectively. Please note that the RDS data format is specific to R and it will be difficult to work with in other languages/environments.
For cross-platform support you might check out Google's ProtoBuf serialization mechanism as implemented in the RProtoBuf package. I have used this library for the export of R's Random Forest models:
library("RProtoBuf")
rf = randomForest(target ~ ., data = mydata)
con = file("rf.pb", open = "wb")
serialize_pb(rf, con)
close(con)