|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.node.port.pmml.PMMLPortObject
public final class PMMLPortObject
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObject |
|---|
PortObject.PortObjectSerializer<T extends PortObject> |
| Field Summary | |
|---|---|
static String |
CDATA
Constant for CDATA. |
static String |
DATA_DICT
Constant for DataDictionary. |
static String |
DATA_FIELD
Constant for DataField. |
static String |
EXTENSION_ELEMENT
Constant for Extension element. |
static Integer[] |
KNIME_V_2_3_3
Version array for KNIME v.2.3.3. |
static Integer[] |
KNIME_V_2_4
Version array for KNIME v.2.4. |
protected static String |
LOCAL_TRANS
Constant for the LocalTransformations tag. |
static String |
PMML_ELEMENT
Constant for PMML Element. |
static String |
PMML_V3_0
Constant for version 3.0. |
static String |
PMML_V3_1
Constant for version 3.1. |
static String |
PMML_V3_2
Constant for version 3.2. |
static String |
PMML_V4_0
Constant for version 4.0. |
static PortType |
TYPE
Convenience accessor for the port type. |
protected static String |
VALUE
Constant for Value. |
| Constructor Summary | |
|---|---|
PMMLPortObject()
Default constructor necessary for loading. |
|
PMMLPortObject(PMMLPortObjectSpec spec)
Creates a new PMML port object. |
|
PMMLPortObject(PMMLPortObjectSpec spec,
PMMLContentHandler handler)
Deprecated. |
|
PMMLPortObject(PMMLPortObjectSpec spec,
org.dmg.pmml40.PMMLDocument pmmlDoc)
Creates a new PMML port object baed on the spec and the PMML document after it has been validated. |
|
PMMLPortObject(PMMLPortObjectSpec spec,
PMMLPortObject port)
Creates a new PMML port based on the PMMLPortObjectSpec and the
PMMLPortObject. |
|
PMMLPortObject(PMMLPortObjectSpec spec,
PMMLPortObject port,
DataTableSpec inData)
Creates a new PMML port based on the PMMLPortObjectSpec and the
PMMLPortObject. |
|
| Method Summary | |
|---|---|
void |
addGlobalTransformations(org.dmg.pmml40.TransformationDictionaryDocument.TransformationDictionary dictionary)
Adds global transformations to the PMML document. |
void |
addModelTranslater(PMMLTranslator modelTranslator)
Adds the model of the content translater to the PMML document. |
void |
addPMMLModelFromHandler(PMMLContentHandler handler)
Deprecated. |
org.dmg.pmml40.DerivedFieldDocument.DerivedField[] |
getDerivedFields()
|
PMMLValue |
getPMMLValue()
Returns the PMML value. |
static PortObject.PortObjectSerializer<PMMLPortObject> |
getPortObjectSerializer()
Static serializer as demanded from PortObject framework. |
PMMLPortObjectSpec |
getSpec()
Get specification to this port object. |
String |
getSummary()
Get a short summary of this PortObject. |
JComponent[] |
getViews()
The returned views are displayed in the out port view of the referring node. |
void |
initializeModelTranslator(PMMLTranslator translator)
|
static boolean |
isKnimeProducedAndOlderThanVersion(org.dmg.pmml40.PMMLDocument.PMML pmml,
Integer[] version)
|
void |
loadFrom(PMMLPortObjectSpec spec,
InputStream is)
Initializes the pmml port object based on the xml input stream. |
void |
loadFrom(PMMLPortObjectSpec spec,
InputStream in,
String version)
Deprecated. |
void |
moveGlobalTransformationsToModel()
Moves the content of the transformation dictionary to local transformations of the model if a model exists. |
void |
save(OutputStream out)
Writes the port object to valid PMML. |
void |
validate()
Validates that this PMMLPortObject contains a valid PMML document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final PortType TYPE
public static final String CDATA
public static final String DATA_DICT
public static final String DATA_FIELD
public static final String PMML_ELEMENT
public static final String EXTENSION_ELEMENT
protected static final String VALUE
protected static final String LOCAL_TRANS
public static final Integer[] KNIME_V_2_3_3
public static final Integer[] KNIME_V_2_4
public static final String PMML_V3_0
public static final String PMML_V3_1
public static final String PMML_V3_2
public static final String PMML_V4_0
| Constructor Detail |
|---|
PMMLPortObject()
public PMMLPortObject(PMMLPortObjectSpec spec)
addModelTranslater(PMMLTranslator).
spec - the referring PMMLPortObjectSpec
public PMMLPortObject(PMMLPortObjectSpec spec,
org.dmg.pmml40.PMMLDocument pmmlDoc)
spec - the PMMLPortObjectSpecpmmlDoc - a PMML document
public PMMLPortObject(PMMLPortObjectSpec spec,
PMMLPortObject port)
PMMLPortObjectSpec and the
PMMLPortObject. If port is null it has the same effect as calling
PMMLPortObject(PMMLPortObjectSpec).
spec - the referring PMMLPortObjectSpecport - the existing PMML portPMMLPortObject(PMMLPortObjectSpec)
public PMMLPortObject(PMMLPortObjectSpec spec,
PMMLPortObject port,
DataTableSpec inData)
PMMLPortObjectSpec and the
PMMLPortObject. If port is null the inData is
used for initialization, otherwise inData is ignored.
spec - the referring PMMLPortObjectSpecport - the existing PMML portinData - the incoming data table specPMMLPortObject(PMMLPortObjectSpec)
@Deprecated
public PMMLPortObject(PMMLPortObjectSpec spec,
PMMLContentHandler handler)
spec - the port object spechandler - the pmml content handler that adds the model content| Method Detail |
|---|
public static final PortObject.PortObjectSerializer<PMMLPortObject> getPortObjectSerializer()
PortObject framework.
@Deprecated
public void addPMMLModelFromHandler(PMMLContentHandler handler)
throws SAXException
PMMLContentHandler.addPMMLModel(DocumentFragment,
PMMLPortObjectSpec) method.
Only PMMLModelType elements can be added.
model - the model fragment to add
SAXException - if the pmml model could not be added
public final void save(OutputStream out)
throws IOException
out - stream which reads the PMML file
IOException - if the file cannot be written to the streampublic void initializeModelTranslator(PMMLTranslator translator)
translator - the model translator to be initializedpublic void addModelTranslater(PMMLTranslator modelTranslator)
modelTranslator - the model translator containing the model to be
addedpublic void moveGlobalTransformationsToModel()
public String getSummary()
PortObject.
The return value will be shown in a node port's tooltip, for instance.
getSummary in interface PortObject
@Deprecated
public void loadFrom(PMMLPortObjectSpec spec,
InputStream in,
String version)
throws IOException,
ParserConfigurationException,
SAXException
loadFrom(PMMLPortObjectSpec, InputStream) instead.
spec - the referring spec of this objectin - the input stream to write toversion - the version (3.0 - 3.2)
SAXException - if something goes wrong during writing
ParserConfigurationException - if the parser cannot be instantiated
IOException - if the file cannot be found
public void loadFrom(PMMLPortObjectSpec spec,
InputStream is)
throws IOException,
org.apache.xmlbeans.XmlException
spec - the referring spec of this objectis - the pmml input stream
IOException - if the file cannot be found
org.apache.xmlbeans.XmlException - if something goes wrong during readingpublic PMMLPortObjectSpec getSpec()
PortObjectSpec which is used to configure any successor node
after execution, e.g. a BufferedDataTable can return a
DataTableSpec.
Subclasses should narrow the return type if possible.
getSpec in interface PortObjectPortObjectSpec or any derived spec,
never null.public JComponent[] getViews()
getViews in interface PortObjectpublic void addGlobalTransformations(org.dmg.pmml40.TransformationDictionaryDocument.TransformationDictionary dictionary)
dictionary - the transformation dictionary that contains the
transformations to be addedpublic org.dmg.pmml40.DerivedFieldDocument.DerivedField[] getDerivedFields()
public PMMLValue getPMMLValue()
public void validate()
throws IllegalStateException
IllegalStateException - if this PMMLPortObject does not contain a
valid PMML document
public static boolean isKnimeProducedAndOlderThanVersion(org.dmg.pmml40.PMMLDocument.PMML pmml,
Integer[] version)
pmml - the PMML documentversion - the KNIME version to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||