pmml (version 1.5.1)

pmml.rpart: Generate PMML for rpart objects

Description

Generate the PMML representation for a rpart object from package rpart.

Usage

"pmml"(model, model.name="RPart_Model", app.name="Rattle/PMML", description="RPart Decision Tree Model", copyright=NULL, transforms=NULL, unknownValue=NULL, dataset=NULL, ...)

Arguments

model
a rpart object.
model.name
a name to be given to the model in the PMML code.
app.name
the name of the application that generated the PMML code.
description
a descriptive text for the Header element of the PMML code.
copyright
the copyright notice for the model.
transforms
data transformations represented in PMML via pmmlTransformations.
unknownValue
value to be used as the 'missingValueReplacement' attribute for all MiningFields.
dataset
the original dataset used to train the model.
...
further arguments passed to or from other methods.

Details

The pmml function supports regression tree as well as classification tree of a rpart object. The object is represented in the PMML TreeModel format.

References

R project CRAN package: rpart: Recursive Partitioning https://CRAN.R-project.org/package=rpart

Examples

Run this code

library(rpart)
fit <- rpart(Species ~ ., data=iris)
pmml(fit)

rm(fit)

Run the code above in your browser using DataCamp Workspace