Was this helpful?
PMML Operators
The Predictive Modeling Markup Language (PMML) is an XML-based markup language used extensively by DataFlow. PMML provides a vendor-independent method of defining mining models that can be used by many of the DataFlow analytics operators. Any operator that consumes or produces a PMML model will do so through the use of a PMMLPort.
Most operators have a method called getModel() that exposes access to the PMMLPort. There are also various utility methods and classes that can be used to manipulate PMML documents in the com.pervasive.dataflow.analytics.pmml package.
Note:  If you are using KNIME version 2.10 or later, then DataFlow uses PMML version 4.2.x. If you are using KNIME 2.9.x, DataFlow uses PMML version 4.0 or 4.1.
DataFlow provides PMML read write operators. For more information, refer to the following topics:
ReadPMML Operator
The ReadPMML operator reads a PMML object model from a PMML file.
Code Example
Using the ReadPMML operator in Java
// Create a PMML reader
ReadPMML reader = graph.add(new ReadPMML("data/model.pmml"));

// You can also set the PMML file to read from after constructing the operator
ReadPMML reader = graph.add(new ReadPMML());
reader.setFilePath("data/model.pmml");
Using the ReadPMML operator in RushScript
// Read a PMML model
var model = dr.readPMML({filePath:'data/model.pmml'});
Properties
The ReadPMML operator provides one property.
Name
Type
Description
filePath
String
The path to the PMML file that will be read.
Ports
The ReadPMML operator provides a single output port.
Name
Type
Get Method
Description
output
getOutput()
The output port that will contain the PMML model that is read from the file.
WritePMML Operator
The WritePMML operator is used to write a PMML object model to a PMML file.
Code Example
Using the WritePMML operator in Java
// Create a PMML writer
WritePMML writer = graph.add(new WritePMML("results/model.pmml"));

// You can also set the PMML file to write to after constructing the operator
WritePMML writer = graph.add(new WritePMML());
writer.setTargetPathName("results/model.pmml");
Using the WritePMML operator in RushScript
// Write a PMML model to a local file
dr.writePMML(model, {targetPathName:'results/model.pmml'});
Properties
The WritePMML operator provides the following properties.
Name
Type
Description
targetPathName
String
The path to the PMML file that will be written.
Ports
The WritePMML operator provides a single input port.
Name
Type
Get Method
Description
input
getModel()
The input port that passes a PMML model to be written to a file.
Last modified date: 03/10/2025