Package 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.ObjectAbstract 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 Description static java.lang.StringPMML_VERSIONPMML version that the jaxbbindings were created from
-
Constructor Summary
Constructors Constructor Description AbstractPMMLProducerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddDataDictionary(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 OPTYPEgetOPTYPE(int wekaType)Returns an OPTYPE for a weka attribute type.static PMMLinitPMML()Initializes a PMML object with header information.
-
-
-
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
-
-
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 questionpmml- 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 headerderived- the derived attribute from which to extract the original name and value from the name created by NominalToBinary.- Returns:
-
-