Class AbstractPMMLProducerHelper

java.lang.Object
weka.classifiers.pmml.producer.AbstractPMMLProducerHelper
Direct Known Subclasses:
LogisticProducerHelper

public abstract class AbstractPMMLProducerHelper extends Object
Abstract base class for PMMLProducer helper classes to extend.
Version:
$Revision: $
Author:
David Persons, Mark Hall (mhall{[at]}pentaho{[dot]}com)
  • Field Details

    • PMML_VERSION

      public static final String PMML_VERSION
      PMML version that the jaxbbindings were created from
      See Also:
  • Constructor Details

    • AbstractPMMLProducerHelper

      public AbstractPMMLProducerHelper()
  • Method Details

    • initPMML

      public static PMML initPMML()
      Initializes a PMML object with header information.
      Returns:
      an initialized PMML object
    • addDataDictionary

      public static void addDataDictionary(Instances trainHeader, PMML pmml)
      Adds a data dictionary to the supplied PMML object.
      Parameters:
      trainHeader - the training data header - i.e. the header of the data that enters the buildClassifier() method of the model in question
      pmml - the PMML object to add the data dictionary to
    • getOPTYPE

      public static OPTYPE getOPTYPE(int wekaType)
      Returns an OPTYPE for a weka attribute type. Note that PMML only supports categorical, continuous and ordinal types.
      Parameters:
      wekaType - the type of the weka attribute
      Returns:
      the PMML type
    • getNameAndValueFromUnsupervisedNominalToBinaryDerivedAttribute

      public static String[] getNameAndValueFromUnsupervisedNominalToBinaryDerivedAttribute(Instances train, Attribute derived)
      Extracts the original attribute name and value from the name of a binary indicator attribute created by unsupervised NominalToBinary. Handles the case where one or more equals signs might be present in the original attribute name.
      Parameters:
      train - the original, unfiltered training header
      derived - the derived attribute from which to extract the original name and value from the name created by NominalToBinary.
      Returns: