Follow

What types of decision tree models built in R can I export to PMML?

If you use the R package rpart, you will be able to export your CART model into PMML by using the PMML package available from Togaware. The PMML package is also available from CRAN. We have extended the original version to also export:
  • Surrogate predicate information;
  • Missing value strategy (default child strategy);
  • Regression trees.

The example below shows how to train a classification tree using the audit dataset provided by Togaware (thanks to Graham Williams).

library(XML);

library(rpart);

library(pmml);

audit <- read.csv(file("http://rattle.togaware.com/audit.csv"));

audit.rpart <- rpart(as.factor(TARGET_Adjusted) ~ ., data=audit[,c(2:10,13)]);

saveXML(pmml(audit.rpart), "AuditTree.xml");


BTW, any models you build in rpart and export using the PMML package can be uploaded directly into ADAPA for scoring.

Also, feel free to watch the video below (featuring this posting).

0 Comments

Article is closed for comments.
Powered by Zendesk