java.lang.Object
com.pervasive.datarush.analytics.pmml.PMMLModel
com.pervasive.datarush.analytics.arm.PMMLAssociationModel
Captures the information required to build a PMML Association model.
An association model requires a list of items with mappings to item
names from the input. It also contains frequent item sets and
association rules.
The frequent item sets contain references to items contained in the item list. The association rules contain references to the defined item sets.
Due to the way the model is defined, the model should be built in this order:
- Item list
- Frequent item sets
- Association rules
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
PMMLModel.MiningFunction -
Constructor Summary
ConstructorsConstructorDescriptionConstruct aPMMLAssociationObjectfrom the given specification.PMMLAssociationModel(Document document) Construct aPMMLAssociationObjectfrom the given PMML represented as an XML DOM. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an association rule to the model.final voidAdd an item to the model.voidaddItemSet(ItemSet itemSet) Add an item set to the model.protected voidbuildModelElement(Element modelElem) Subclasses must implement this method to fill-in the contents of the model element.Get the algorithm name.doubleGet the average items per transaction value.Create a mapping from item identifier to item label of the items contained in this model.Create a mapping from item identifier to item name of the items contained in this model.getItems()Return the list of items contained in the model.Return the list of frequent item sets contained in the model.intGet the maximum items per transaction value.doubleGet the minimum confidence setting.doubleGet the minimum support setting.protected StringReturn the element name of the primary model element associated with this PMMLgetRules()Return the list of association rules contained in the model.longGet the transaction count value.protected voidparseModelElement(Element modelElem) Parse the given model element into the respective model object.voidsetAlgorithmName(String algorithmName) Set the name of the algorithm used to generate the association model.voidsetAvgItemsPerTxn(double avgItemsPerTxn) Set the average items per transaction value.voidsetMaxItemsPerTxn(int maxItemsPerTxn) Set the maximum items per transaction value.voidsetMinConfidence(double minConfidence) Set the minimum confidence used to generate the rules within this association model.voidsetMinSupport(double minSupport) Set the minimum support setting.voidsetTxnCount(long txnCount) Set the transaction count value.Methods inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
findModelElement, getAnnotationText, getModelExplanation, getModelSpec, getVersion, parse, setAnnotationText, setModelExplanation, setVersion, toPMML
-
Constructor Details
-
PMMLAssociationModel
Construct aPMMLAssociationObjectfrom the given specification.- Parameters:
spec- input specification
-
PMMLAssociationModel
Construct aPMMLAssociationObjectfrom the given PMML represented as an XML DOM.- Parameters:
document- input PMML model
-
-
Method Details
-
getTxnCount
public long getTxnCount()Get the transaction count value.- Returns:
- transaction count
-
setTxnCount
public void setTxnCount(long txnCount) Set the transaction count value.- Parameters:
txnCount- transaction count
-
getMinSupport
public double getMinSupport()Get the minimum support setting.- Returns:
- minimum support
-
setMinSupport
public void setMinSupport(double minSupport) Set the minimum support setting.- Parameters:
minSupport- minimum support
-
getMaxItemsPerTxn
public int getMaxItemsPerTxn()Get the maximum items per transaction value.- Returns:
- maximum items per transaction
-
setMaxItemsPerTxn
public void setMaxItemsPerTxn(int maxItemsPerTxn) Set the maximum items per transaction value.- Parameters:
maxItemsPerTxn- maximum items per transaction
-
getAvgItemsPerTxn
public double getAvgItemsPerTxn()Get the average items per transaction value.- Returns:
- average items per transaction
-
setAvgItemsPerTxn
public void setAvgItemsPerTxn(double avgItemsPerTxn) Set the average items per transaction value.- Parameters:
avgItemsPerTxn- average items per transaction
-
getAlgorithmName
Get the algorithm name.- Returns:
- algorithm name
-
getMinConfidence
public double getMinConfidence()Get the minimum confidence setting.- Returns:
- minimum confidence
-
setMinConfidence
public void setMinConfidence(double minConfidence) Set the minimum confidence used to generate the rules within this association model.- Parameters:
minConfidence- minimum confidence value
-
setAlgorithmName
Set the name of the algorithm used to generate the association model. This is an opaque value within the model but useful to help determine how the model was created.- Parameters:
algorithmName- the name of the algorithm used
-
addItem
Add an item to the model. The given name will be mapped to the given identifier.- Parameters:
item- the item to add to the model
-
getItems
Return the list of items contained in the model.- Returns:
- frequent items
-
getItemNameMap
Create a mapping from item identifier to item name of the items contained in this model.- Returns:
- mapping from item identifier to item name
-
getItemLabelMap
Create a mapping from item identifier to item label of the items contained in this model.- Returns:
- mapping from item identifier to item label
-
getItemSets
Return the list of frequent item sets contained in the model.- Returns:
- frequent item sets
-
getRules
Return the list of association rules contained in the model.- Returns:
- association rules
-
addItemSet
Add an item set to the model. Items contained within the set must be contained within the list of items provided. The set includes a support value.- Parameters:
itemSet- the item set to add to the model
-
addAssociationRule
Add an association rule to the model. The antecedent and consequent of the rule are item sets. The item sets must already be contained within the model.- Parameters:
rule- an association rule to add to the model
-
getModelElementName
Description copied from class:PMMLModelReturn the element name of the primary model element associated with this PMML- Specified by:
getModelElementNamein classPMMLModel- Returns:
- the element name of the primary model element
-
buildModelElement
Description copied from class:PMMLModelSubclasses must implement this method to fill-in the contents of the model element. At the time this method is invoked, the element will have its name and MiningSchema sub-element populated.- Specified by:
buildModelElementin classPMMLModel- Parameters:
modelElem- the model element
-
parseModelElement
Description copied from class:PMMLModelParse the given model element into the respective model object.- Specified by:
parseModelElementin classPMMLModel- Parameters:
modelElem- root element of model object
-