Package weka.classifiers.pmml.producer
Class AbstractPMMLProducerHelper
java.lang.Object
weka.classifiers.pmml.producer.AbstractPMMLProducerHelper
- Direct Known Subclasses:
LogisticProducerHelper
Abstract base class for PMMLProducer helper classes to extend.
- Version:
- $Revision: $
- Author:
- David Persons, Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
PMML version that the jaxbbindings were created from -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDataDictionary
(Instances trainHeader, PMML pmml) Adds a data dictionary to the supplied PMML object.static String[]
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.
-
Field Details
-
PMML_VERSION
PMML version that the jaxbbindings were created from- See Also:
-
-
Constructor Details
-
AbstractPMMLProducerHelper
public AbstractPMMLProducerHelper()
-
-
Method Details
-
initPMML
Initializes a PMML object with header information.- Returns:
- an initialized PMML object
-
addDataDictionary
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
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 headerderived
- the derived attribute from which to extract the original name and value from the name created by NominalToBinary.- Returns:
-