org.knime.core.node.port.pmml
Class PMMLPortObjectSpec

java.lang.Object
  extended by org.knime.core.node.port.pmml.PMMLPortObjectSpec
All Implemented Interfaces:
PortObjectSpec

public class PMMLPortObjectSpec
extends Object
implements PortObjectSpec

Author:
Fabian Dill, University of Konstanz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.node.port.PortObjectSpec
PortObjectSpec.PortObjectSpecSerializer<T extends PortObjectSpec>
 
Field Summary
static String KNIME
          The application name for PMML generated with KNIME.
 
Constructor Summary
PMMLPortObjectSpec(DataTableSpec dataDictionary, List<String> preprocFields, List<String> learningFields, List<String> targetFields)
          PMMLPortObjectSpec should only be created by PMMLPortObjectSpecCreator.
 
Method Summary
 List<DataColumnSpec> getActiveCols()
           
 Set<String> getActiveFields()
           
 DataTableSpec getDataTableSpec()
           
 List<DataColumnSpec> getLearningCols()
           
 List<String> getLearningFields()
           
static PortObjectSpec.PortObjectSpecSerializer<PMMLPortObjectSpec> getPortObjectSpecSerializer()
           
 List<DataColumnSpec> getPreprocessingCols()
           
 List<String> getPreprocessingFields()
           
 List<DataColumnSpec> getTargetCols()
           
 List<String> getTargetFields()
           
 JComponent[] getViews()
          The returned views are displayed in the out port view of the referring node.
static PMMLPortObjectSpec loadFrom(PortObjectSpecZipInputStream in)
           
 void saveTo(PortObjectSpecZipOutputStream out)
           
static void writeHeader(org.dmg.pmml40.PMMLDocument.PMML pmmlDoc)
           
static void writeMiningSchema(PMMLPortObjectSpec portSpec, TransformerHandler handler)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KNIME

public static final String KNIME
The application name for PMML generated with KNIME.

See Also:
Constant Field Values
Constructor Detail

PMMLPortObjectSpec

PMMLPortObjectSpec(DataTableSpec dataDictionary,
                   List<String> preprocFields,
                   List<String> learningFields,
                   List<String> targetFields)
PMMLPortObjectSpec should only be created by PMMLPortObjectSpecCreator.

Parameters:
dataDictionary - DataTableSpec describing the training data
preprocFields - all columns involved in preprocessing steps
learningFields - columns used for learning of the model
targetFields - columns to be predicted
Method Detail

getPortObjectSpecSerializer

public static PortObjectSpec.PortObjectSpecSerializer<PMMLPortObjectSpec> getPortObjectSpecSerializer()
Returns:
the serializer
See Also:
PortObjectSpec

getDataTableSpec

public DataTableSpec getDataTableSpec()
Returns:
the DataTableSpec describing the training data

getLearningFields

public List<String> getLearningFields()
Returns:
those columns used for learning of the model

getLearningCols

public List<DataColumnSpec> getLearningCols()
Returns:
those columns used for learning of the model

getTargetFields

public List<String> getTargetFields()
Returns:
by the model predicted columns

getTargetCols

public List<DataColumnSpec> getTargetCols()
Returns:
those columns used for learning of the model

getPreprocessingFields

public List<String> getPreprocessingFields()
Returns:
those columns involved in preprocessing steps

getPreprocessingCols

public List<DataColumnSpec> getPreprocessingCols()
Returns:
those columns involved in preprocessing steps

getActiveFields

public Set<String> getActiveFields()
Returns:
those columns used for preprocessing and learning the model

getActiveCols

public List<DataColumnSpec> getActiveCols()
Returns:
those columns used for preprocessing and learning the model

writeHeader

public static void writeHeader(org.dmg.pmml40.PMMLDocument.PMML pmmlDoc)
Parameters:
pmmlDoc - the PMML document to write the header to

saveTo

public void saveTo(PortObjectSpecZipOutputStream out)
            throws IOException
Parameters:
out - zipped stream to write the entries to
Throws:
IOException - if something goes wrong

loadFrom

public static PMMLPortObjectSpec loadFrom(PortObjectSpecZipInputStream in)
                                   throws IOException,
                                          InvalidSettingsException
Parameters:
in - stream reading the relevant files
Returns:
a completely loaded port object spec with DataTableSpec, and the sets of learning, ignored and target columns.
Throws:
IOException - if something goes wrong
InvalidSettingsException - if something goes wrong

getViews

public JComponent[] getViews()
The returned views are displayed in the out port view of the referring node. Each component is displayed in an extra tab. The name of the component is used as the title for the tab. It is important that no external members are kept in the component so it can be deleted, when the port object is deleted. If the port object has no view return an empty array.

Specified by:
getViews in interface PortObjectSpec
Returns:
an array of views for the port object spec, each displayed as a tab in the out port view

writeMiningSchema

@Deprecated
public static void writeMiningSchema(PMMLPortObjectSpec portSpec,
                                                TransformerHandler handler)
                              throws SAXException
Deprecated. 

Writes the MiningSchema based upon the fields of the passed PMMLPortObjectSpec. Since the MiningSchema is inside the model tag of the PMML file, implementing classes have to take open their model tag, then call this method, write their model content and close the model tag.

Parameters:
portSpec - based upon this port object spec the mining schema is written
handler - transformation handler to write to PMMLPortObject.PMML_V3_1. This method fails if the version is unsupported.
Throws:
SAXException - if something goes wrong


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.