Generate the PMML representation for a randomForest object from package randomForest.
# S3 method for randomForest
pmml(model, model.name="randomForest_Model",
app.name="Rattle/PMML",
description="Random Forest Tree Model",
copyright=NULL, transforms=NULL, unknownValue=NULL,
parentInvalidValueTreatment="returnInvalid",
childInvalidValueTreatment="asIs", ...)
a randomForest
object.
a name to be given to the model in the PMML code.
the name of the application that generated the PMML code.
a descriptive text for the Header element of the PMML code.
the copyright notice for the model.
data transformations represented in PMML via pmmlTransformations.
value to be used as the 'missingValueReplacement' attribute for all MiningFields.
invalid value treatment at the top MiningField level.
invalid value treatment at the model segment MiningField level.
further arguments passed to or from other methods.
This function outputs a Random Forest in PMML format. The model will include not just the forest but also any pre-processing applied to the training data.
R project CRAN package: randomForest: Breiman and Cutler's random forests for classification and regression https://CRAN.R-project.org/package=randomForest
# NOT RUN {
# Build a simple randomForest model
library(randomForest)
iris.rf <- randomForest(Species ~ ., data=iris, ntree=20)
# Convert to pmml
pmml(iris.rf)
rm(iris.rf)
# }
Run the code above in your browser using DataLab