Can Pmml Models Be Read in R

Can PMML models be read in R?

Unfortunately, it is not possible to import a model in PMML format in order to predict the classes of some instances using R.

The pmml package only allow you to train a model in R and then export it.

Load model in Scala/Java from pmml created in R

You're using a legacy JPMML library, which was discontinued 3+ years ago. Naturally, it doesn't support new PMML features (such as PMML 4.2 and 4.3 schemas) that have been added since then.

Simply upgrade to the JPMML-Evaluator library. As a bonus, your code will be much shorter and cleaner.

Change version of pmml XML file R

You should try out the r2pmml package, which can do everything that the legacy pmml package does, and then some more.

Otherwise, you'd need to download a previous version of the legacy pmml package, or manually change the XML namespace declaration of the returned XML file - there is no other way.

Can't export xgboost model to pmml format in R

Alternatively, if correctness and conversion speed matter to you, then you can use the R2PMML package for converting R language XGBoost models to PMML.

library("r2pmml")

r2pmml(bst, "xgboost.pmml", fmap = as.fmap(dev_samp[,1:2]), response_name = colnames(dev_samp)[3])

Be sure to use the latest R2PMML package version (direct install from GitHub repository). The CRAN version is currently a bit outdated (does not provide the as.fmap(..) utility function).



Related Topics



Leave a reply



Submit