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

java.lang.Object
  extended by org.knime.base.node.mine.neural.mlp.PMMLNeuralNetworkTranslator
All Implemented Interfaces:
PMMLTranslator

public class PMMLNeuralNetworkTranslator
extends Object
implements PMMLTranslator

A NeuralNetwork translator class between KNIME and PMML.

Author:
Dominik Morent, KNIME.com AG, Zurich, Switzerland, wenlin, Zementis, May 2011

Constructor Summary
PMMLNeuralNetworkTranslator()
          Creates a new neural network translator.
PMMLNeuralNetworkTranslator(MultiLayerPerceptron mlp)
          Creates an initialized neural network handler that can be used to output the neural network model.
 
Method Summary
protected  void addInputLayer(org.dmg.pmml40.NeuralNetworkDocument.NeuralNetwork nnModel, MultiLayerPerceptron mlp)
          Writes the PMML input layer of the MLP.
protected  void addLayer(org.dmg.pmml40.NeuralNetworkDocument.NeuralNetwork nnModel, MultiLayerPerceptron mlp, int layer)
          Writes a layer of the MLP.
protected  void addOutputLayer(org.dmg.pmml40.NeuralNetworkDocument.NeuralNetwork nnModel, MultiLayerPerceptron mlp, PMMLPortObjectSpec spec)
          Writes the PMML output layer of the MLP.
 org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc, PMMLPortObjectSpec spec)
          Exports the translators state to a PMML document.
 MultiLayerPerceptron getMLP()
           
 void initializeFrom(org.dmg.pmml40.PMMLDocument pmmlDoc)
          Initializes the translator based on a PMML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMMLNeuralNetworkTranslator

public PMMLNeuralNetworkTranslator(MultiLayerPerceptron mlp)
Creates an initialized neural network handler that can be used to output the neural network model.

Parameters:
mlp - the neural network

PMMLNeuralNetworkTranslator

public PMMLNeuralNetworkTranslator()
Creates a new neural network translator. The initialization has to be performed by registering the handler to a parser.

Method Detail

initializeFrom

public void initializeFrom(org.dmg.pmml40.PMMLDocument pmmlDoc)
Initializes the translator based on a PMML document.

Specified by:
initializeFrom in interface PMMLTranslator
Parameters:
pmmlDoc - the PMML document

exportTo

public org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc,
                                               PMMLPortObjectSpec spec)
Exports the translators state to a PMML document.

Specified by:
exportTo in interface PMMLTranslator
Parameters:
pmmlDoc - the PMML document to export to
spec - the spec of the PMMLPortObject
Returns:
the schema type of the exported schema if applicable, otherwise null

addInputLayer

protected void addInputLayer(org.dmg.pmml40.NeuralNetworkDocument.NeuralNetwork nnModel,
                             MultiLayerPerceptron mlp)
Writes the PMML input layer of the MLP.

Parameters:
nnModel - the Neural Network model.
mlp - the underlying MultiLayerPerceptron.

addLayer

protected void addLayer(org.dmg.pmml40.NeuralNetworkDocument.NeuralNetwork nnModel,
                        MultiLayerPerceptron mlp,
                        int layer)
Writes a layer of the MLP.

Parameters:
nnModel - the NeuralNetwork model.
mlp - the underlying MultiLayerPerceptron.
layer - the number of the current layer.

addOutputLayer

protected void addOutputLayer(org.dmg.pmml40.NeuralNetworkDocument.NeuralNetwork nnModel,
                              MultiLayerPerceptron mlp,
                              PMMLPortObjectSpec spec)
Writes the PMML output layer of the MLP.

Parameters:
nnModel - the neural network model.
mlp - the underlying MultiLayerPerceptron.
spec - the port object spec

getMLP

public MultiLayerPerceptron getMLP()
Returns:
the mlp


Copyright, 2003 - 2012. 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.