org.knime.base.node.mine.cluster
Class PMMLClusterTranslator

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

public class PMMLClusterTranslator
extends Object
implements PMMLTranslator

A Cluster translator class between KNIME and PMML. Modified from the original PMMLClusterHandler.java by Fabian Dill.

Author:
wenlin, Zementis, Apr 2011

Nested Class Summary
static class PMMLClusterTranslator.ComparisonMeasure
          Constants indicating whether the squared euclidean or the euclidean comparison measure should be used.
 
Constructor Summary
PMMLClusterTranslator()
          Constructor.
PMMLClusterTranslator(PMMLClusterTranslator.ComparisonMeasure measure, int nrOfClusters, double[][] prototypes, int[] clusterCoverage, Set<String> colSpecs)
          Constructor.
 
Method Summary
 org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc, PMMLPortObjectSpec spec)
          Exports the translators state to a PMML document.
 PMMLClusterTranslator.ComparisonMeasure getComparisonMeasure()
           
 String[] getLabels()
           
 double[][] getPrototypes()
           
 Set<String> getUsedColumns()
           
 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

PMMLClusterTranslator

public PMMLClusterTranslator(PMMLClusterTranslator.ComparisonMeasure measure,
                             int nrOfClusters,
                             double[][] prototypes,
                             int[] clusterCoverage,
                             Set<String> colSpecs)
Constructor. Pass the KNIME cluster information to the translator.

Parameters:
measure - the comparison measure
nrOfClusters - number of clusters
prototypes - the clusters
clusterCoverage - the size of clusters
colSpecs - the fields used as cluster coordinates

PMMLClusterTranslator

public PMMLClusterTranslator()
Constructor. Create an empty translator, leaving required cluster model information uninitialized.

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

getComparisonMeasure

public PMMLClusterTranslator.ComparisonMeasure getComparisonMeasure()
Returns:
the measure

getLabels

public String[] getLabels()
Returns:
the labels

getPrototypes

public double[][] getPrototypes()
Returns:
the prototypes

getUsedColumns

public Set<String> getUsedColumns()
Returns:
the usedColumns


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.