Friday, February 8, 2008

What types of regression models built with R can I export to PMML?

Quick answer:
  • Linear Regression
  • Binary Logistic Regression
You can basically export any linear regression models you build using the R glm function and the gaussian family into PMML 3.2 by using the PMML package available from Togaware. See link below:

http://rattle.togaware.com/

The PMML package is also available through CRAN.

The function to be used is named pmml.lm. The original version only allowed for the exporting of linear regression models. We have extended it to also export binary logistic regression models built using the R function glm and the binomial family.

The following example trains a binary logistic regression model for the audit dataset and exports its equivalent PMML 3.2 code:

audit <- read.csv(file("http://rattle.togaware.com/audit.csv"))
binlog <- glm(Adjusted ~ ., data=crs$dataset[crs$sample,c(2:8,10:13)], family=binomial(logit))
pmml.lm(binlog)

Note that this function does not support multinomial logistic regression models or any other regression models built using the VGAM package.

0 comments: