weka.classifiers.pmml.producer

## Class AbstractPMMLProducerHelper

- java.lang.Object
- - weka.classifiers.pmml.producer.AbstractPMMLProducerHelper

- Direct Known Subclasses:
    LogisticProducerHelper

      public abstract class AbstractPMMLProducerHelper
      extends java.lang.Object

  Abstract base class for PMMLProducer helper classes to extend.
  Version:
    $Revision: $
  Author:
    David Persons, Mark Hall (mhall{[at]}pentaho{[dot]}com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `PMML_VERSION` PMML version that the jaxbbindings were created from

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractPMMLProducerHelper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addDataDictionary(Instances trainHeader, PMML pmml)` Adds a data dictionary to the supplied PMML object.
    `static java.lang.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.
    `static OPTYPE` | `getOPTYPE(int wekaType)` Returns an OPTYPE for a weka attribute type.
    `static PMML` | `initPMML()` Initializes a PMML object with header information.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PMML_VERSION

          public static final java.lang.String PMML_VERSION

      PMML version that the jaxbbindings were created from
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractPMMLProducerHelper

          public AbstractPMMLProducerHelper()

  - ### Method Detail

    - #### 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 java.lang.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: