org.knime.base.node.mine.decisiontree2
Class PMMLDecisionTreeTranslator

java.lang.Object
  extended by org.knime.base.node.mine.decisiontree2.PMMLDecisionTreeTranslator
All Implemented Interfaces:
PMMLTranslator

public class PMMLDecisionTreeTranslator
extends Object
implements PMMLTranslator

A DecisionTree translator class between KNIME and PMML.

Author:
wenlin, Zementis Inc., Apr 2011

Constructor Summary
PMMLDecisionTreeTranslator()
          For usage with the initializeFrom(PMMLDocument) method.
PMMLDecisionTreeTranslator(DecisionTree tree)
          Creates a new decision tree translator initialized with the decision tree.
 
Method Summary
 org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc, PMMLPortObjectSpec spec)
          Exports the translators state to a PMML document.
 DecisionTree getDecisionTree()
           
 void initializeFrom(org.dmg.pmml40.PMMLDocument pmmlDoc)
          Initializes the translator based on a PMML document.
 DecisionTree parseDecTreeFromModel(org.dmg.pmml40.TreeModelDocument.TreeModel treeModel)
          Builds a decision tree object out of the TreeModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMMLDecisionTreeTranslator

public PMMLDecisionTreeTranslator(DecisionTree tree)
Creates a new decision tree translator initialized with the decision tree. For usage with the exportTo(PMMLDocument, PMMLPortObjectSpec) method.

Parameters:
tree - the KNIME decision tree

PMMLDecisionTreeTranslator

public PMMLDecisionTreeTranslator()
For usage with the initializeFrom(PMMLDocument) method.

Method Detail

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

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

parseDecTreeFromModel

public DecisionTree parseDecTreeFromModel(org.dmg.pmml40.TreeModelDocument.TreeModel treeModel)
Builds a decision tree object out of the TreeModel.

Parameters:
treeModel - treeModel parsed from the PMML.
Returns:
DecisionTreeModel for further processing.

getDecisionTree

public DecisionTree getDecisionTree()
Returns:
the decision tree stored by this translator


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.