org.knime.base.node.mine.neural.mlp
Class PMMLNeuralNetworkPortObject

java.lang.Object
  extended by org.knime.core.node.port.pmml.PMMLPortObject
      extended by org.knime.base.node.mine.neural.mlp.PMMLNeuralNetworkPortObject
All Implemented Interfaces:
PortObject

public class PMMLNeuralNetworkPortObject
extends PMMLPortObject

A PMMLPortObject responsible for transforming a MultiLayer Perceptron (MLP) into a PMML file.

Author:
cebron, University of Konstanz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObject
PortObject.PortObjectSerializer<T extends PortObject>
 
Field Summary
static PortType TYPE
          PMML Neural Network port type.
 
Fields inherited from class org.knime.core.node.port.pmml.PMMLPortObject
CDATA, DATA_DICT, DATA_FIELD, PMML_V3_0, PMML_V3_1, PMML_V3_2, VALUE
 
Constructor Summary
PMMLNeuralNetworkPortObject()
          Empty constructor.
PMMLNeuralNetworkPortObject(PMMLPortObjectSpec spec, MultiLayerPerceptron mlp)
          Constructor.
 
Method Summary
protected  void addInputLayer(TransformerHandler handler, MultiLayerPerceptron mlp)
          Writes the PMML input layer of the MLP.
protected  void addLayer(TransformerHandler handler, MultiLayerPerceptron mlp, int layer)
          Writes a layer of the MLP.
protected  void addOutputLayer(TransformerHandler handler, MultiLayerPerceptron mlp)
          Writes the PMML output layer of the MLP.
protected  void addTargets(TransformerHandler handler, MultiLayerPerceptron mlp)
          Writes the PMML target attributes.
 MultiLayerPerceptron getMLP()
           
 String getSummary()
          Get a short summary of this PortObject.
 void loadFrom(PMMLPortObjectSpec spec, InputStream in, String version)
          
protected  void writePMMLModel(TransformerHandler handler)
          
 
Methods inherited from class org.knime.core.node.port.pmml.PMMLPortObject
addPMMLContentHandler, getLocalSchemaLocation, getModelType, getPMMLContentHandler, getPortObjectSerializer, getSpec, getViews, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final PortType TYPE
PMML Neural Network port type.

Constructor Detail

PMMLNeuralNetworkPortObject

public PMMLNeuralNetworkPortObject()
Empty constructor.


PMMLNeuralNetworkPortObject

public PMMLNeuralNetworkPortObject(PMMLPortObjectSpec spec,
                                   MultiLayerPerceptron mlp)
Constructor.

Parameters:
spec - the PMMLPortObjectSpec of the training table.
mlp - the MultiLayerPerceptron from KNIME to be written.
Method Detail

writePMMLModel

protected void writePMMLModel(TransformerHandler handler)
                       throws SAXException

Specified by:
writePMMLModel in class PMMLPortObject
Parameters:
handler - the handler responsible for writing the PMML
Throws:
SAXException - if something goes wrong during writing the PMML

addTargets

protected void addTargets(TransformerHandler handler,
                          MultiLayerPerceptron mlp)
                   throws SAXException
Writes the PMML target attributes.

Parameters:
handler - to write to.
mlp - the underlying MultiLayerPerceptron.
Throws:
SAXException - if something goes wrong.

addInputLayer

protected void addInputLayer(TransformerHandler handler,
                             MultiLayerPerceptron mlp)
                      throws SAXException
Writes the PMML input layer of the MLP.

Parameters:
handler - to write to.
mlp - the underlying MultiLayerPerceptron.
Throws:
SAXException - if something goes wrong.

addLayer

protected void addLayer(TransformerHandler handler,
                        MultiLayerPerceptron mlp,
                        int layer)
                 throws SAXException
Writes a layer of the MLP.

Parameters:
handler - to write to.
mlp - the underlying MultiLayerPerceptron.
layer - the number of the current layer.
Throws:
SAXException - if something goes wrong.

addOutputLayer

protected void addOutputLayer(TransformerHandler handler,
                              MultiLayerPerceptron mlp)
                       throws SAXException
Writes the PMML output layer of the MLP.

Parameters:
handler - to write to.
mlp - the underlying MultiLayerPerceptron.
Throws:
SAXException - if something goes wrong.

loadFrom

public void loadFrom(PMMLPortObjectSpec spec,
                     InputStream in,
                     String version)
              throws ParserConfigurationException,
                     SAXException,
                     IOException

Overrides:
loadFrom in class PMMLPortObject
Parameters:
spec - the referring spec of this object
in - the input stream to write to
version - the version (3.0 - 3.1)
Throws:
ParserConfigurationException - if the parser cannot be instantiated
SAXException - if something goes wrong during writing
IOException - if the file cannot be found

getMLP

public MultiLayerPerceptron getMLP()
Returns:
the MultiLayerPerceptron.

getSummary

public String getSummary()
Get a short summary of this PortObject. The return value will be shown in a node port's tooltip, for instance.

Specified by:
getSummary in interface PortObject
Specified by:
getSummary in class PMMLPortObject
Returns:
Summary of the object's content, suitable for a tooltip. Empty strings and null result values are ok (though not encouraged).


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.