The data transformation functions previously available in the separate
pmmlTransformations
package have been merged into pmml
starting with version 2.0.0.
This function can also be used to output variable transformations in PMML
format. In particular, it can be used as a transformations generator.
Various transformation operations can be implemented in R and those
transformations can then be output in PMML format by calling the function
with a NULL value for the model input and a data transformation object as
the transforms input. Please see the documentation for xform_wrap
for
more information on how to create a data transformation object.
In addition, the pmml
function can also be called using a
pre-existing PMML model as the first input and a data transformation 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 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 transformations starting from an original
field and multiple fields derived from the same original field.
This package exports models to PMML version 4.4.1.
Please note that package XML_3.95-0.1 or later is required to perform
the full and correct functionality of pmml.
If data used for an R model contains features of type character
,
these must be converted to factors before the model is trained and converted
with pmml
.
A list of all the supported models and packages is available in the
vignette:
vignette("packages_and_functions", package="pmml")
.