A PMML package for R that exports all kinds of predictive models is available directly from CRAN.

The * pmml* package offers support for the following model types:

- ksvm (kernlab): Support Vector Machines
- nnet: Neural Networks
- rpart: C&RT Decision Trees
- lm & glm (stats): Linear and Binary Logistic Regression Models
- arules: Association Rules
- kmeans and hclust: Clustering Models
- multinom (nnet): Multinomial Logistic Regression Models
- glm (stats): Generalized Linear Models for classification and regression with a wide variety of link functions
- randomForest: Random Forest Models for classification and regression
- coxph (survival): Cox Regression Models to calculate survival and stratified cumulative hazards
- naiveBayes (e1071): Naive Bayes Classifiers
- glmnet: Linear ElasticNet Regression Models
- ada: Stochastic Boosting
- svm (e1071): Support Vector Machines

**New Features**

The new

*package offers additional features:***pmml**- Add and insert arbitrary attributes to already created PMML models
- Add and insert arbitrary elements to already created PMML models
- Create various child elements allowed in the PMML schema so as to add them using the above functions
- Such elements include DataField, Output, OutputField, Interval, Value

The

*package can also export data transformations built with the***pmml***package (see below). It can also be used to merge two disctinct PMML files into one. For example, if transformations and model were saved into separate PMML files, it can combine both files into one, as described in Chapter 5 of the PMML book - PMML in Action.***pmmlTransformations**### How does it work?

Simple, once you build your model using any of the supported model types, pass the model object as an input parameter to the pmml function as shown in the figure below:

Example - sequence of R commands used to build a linear regression model using lm and the Iris dataset:

**Documentation**

For more on the * pmml* package, please take a look at the paper we published in The R Journal. For that, just follow the link below:

1) Paper: PMML: An Open Standard for Sharing Models

Also, make sure to check out the package's documentation from CRAN:

2) CRAN: pmml Package

## 0 Comments