The 'pmml' function can also be called using a pre-existing PMML model as the first input and a pmmlTransformations object as the transforms input. The result is a new PMML model with the transformation inserted as a 'LocalTransformations' element in the original model. If the original model already had a 'LocalTransformations' element, the new information will be appended to that element. If the model variables are derived directly from or from a chain of transformations defined in the transforms input, the field names in the model are replaced with the original field names with the correct data types to make a consistent model. The covered cases include model fields derived from an original field, model fields derived from a chain of transforms starting from an original field and mutiple fields derived from the same original field. Please see the description of the 'addLT' function for more details on how the 'pmml' function adds a new transformations information.
pmml(model, model.name="Rattle_Model", app.name="Rattle/PMML",
description=NULL, copyright=NULL, transforms=NULL, dataset=NULL,
...)
PMML home page:
A. Guazzelli, M. Zeller, W. Lin, G. Williams (2009), PMML: An Open Standard for Sharing Models. The R journal, Volume 1/1, 60-65 A. Guazzelli, T. Jena, W. Lin, M. Zeller (2013). Extending the Naive Bayes Model Element in PMML: Adding Support for Continuous Input Variables. In Proceedings of the 19th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. T. Jena, A. Guazzelli, W. Lin, M. Zeller (2013). The R pmmlTransformations Package. In Proceedings of the 19th ACM SIGKDD Conference on Knowledge Discovery and Data Mining.
pmml.rules
,
pmml.hclust
,
pmml.kmeans
,
pmml.ksvm
,
pmml.glm
,
pmml.cv.glmnet
,
pmml.lm
,
pmml.naiveBayes
,
pmml.nnet
,
pmml.multinom
,
pmml.rpart
,
pmml.randomForest
,
pmml.rfsrc
,
pmmltoc
.# Build a simple lm model
(iris.lm <- lm(Sepal.Length ~ ., data=iris))
# Convert to pmml
pmml(iris.lm)
# Create a pmmlTransformations object
library(pmmlTransformations)
xo <- WrapData(iris)
# Transform the 'Sepal.Length' variable
xo <- MinMaxXform(xo,xformInfo="column1->d_sl")
# Output the tranformation in PMML format
pmml(NULL, transforms=xo)
Run the code above in your browser using DataLab