- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.CompositeOperator
-
- com.pervasive.datarush.analytics.arm.fpgrowth.FPGrowth
-
- All Implemented Interfaces:
LogicalOperator,RecordSinkOperator,SinkOperator<RecordPort>,Serializable
public class FPGrowth extends CompositeOperator implements Serializable, RecordSinkOperator
An operator that implements the FP-growth algorithm, outputting a PMML model containing generated items sets and association rules.The input data is required to have two fields: a transaction identifier and an item identifier. The transaction identifier discriminates transactions. The item identifier identifies items within transactions. Transactions are assumed to be in line item order (i.e. one input record per item in a transaction). Transactions records are also assumed to be contiguous. An optional label field may also be specified which will be used for display purposes instead of the transaction identifiers.
The output is a PMML based association model. The model contains frequent items, frequent item sets and association rules.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FPGrowth()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcompose(CompositionContext ctx)Compose the body of this operator.StringgetAnnotationText()Get the annotation text property.RecordPortgetInput()Get the input port that should contain transactions.StringgetItemFieldName()Get the item field name property.RecordPortgetItemSets()Get the output port containing the frequent item sets.intgetK()Get the item-set cardinality property.StringgetLabelFieldName()Get the optional label field name property.doublegetMinConfidence()Get the minimum confidence property.doublegetMinSupport()Get the minimum support property.PMMLPortgetModel()Get the output port containing the generated PMML-based association model.StringgetTxnFieldName()Get the transaction identifier field name property.voidsetAnnotationText(String annotationText)The text provided will be added as an annotation to the output PMML model.voidsetItemFieldName(String itemFieldName)Set the item field name property.voidsetK(int k)Set the largest item-set cardinality wanted.voidsetLabelFieldName(String labelFieldName)Set the optional label field name property.voidsetMinConfidence(double minConfidence)Set the minimum confidence threshold.voidsetMinSupport(double minSupport)Set the minimum support property.voidsetTxnFieldName(String txnFieldName)Set the transaction identifier field name property.-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
-
-
-
Method Detail
-
getTxnFieldName
public String getTxnFieldName()
Get the transaction identifier field name property.- Returns:
- transaction field name
-
setTxnFieldName
public void setTxnFieldName(String txnFieldName)
Set the transaction identifier field name property.- Parameters:
txnFieldName- transaction field name
-
getItemFieldName
public String getItemFieldName()
Get the item field name property.- Returns:
- item field name
-
setItemFieldName
public void setItemFieldName(String itemFieldName)
Set the item field name property.- Parameters:
itemFieldName- item field name
-
getLabelFieldName
public String getLabelFieldName()
Get the optional label field name property.- Returns:
- label field name
-
setLabelFieldName
public void setLabelFieldName(String labelFieldName)
Set the optional label field name property.- Parameters:
labelFieldName- label field name
-
getMinSupport
public double getMinSupport()
Get the minimum support property.- Returns:
- minimum support
-
setMinSupport
public void setMinSupport(double minSupport)
Set the minimum support property. This property is a floating point number between 0 and 1 (exclusive) that defines the percentage of transactions an item must participate in to be considered frequent.- Parameters:
minSupport- minimum support
-
getK
public int getK()
Get the item-set cardinality property.- Returns:
- item-set cardinality
-
setK
public void setK(int k)
Set the largest item-set cardinality wanted. The default value is zero, which implies that all cardinality item-sets should be discovered.- Parameters:
k- the largest item-set cardinality wanted
-
getMinConfidence
public double getMinConfidence()
Get the minimum confidence property.- Returns:
- minimum confidence
-
setMinConfidence
public void setMinConfidence(double minConfidence)
Set the minimum confidence threshold.The minimum confidence value must be between 0.0 and 1.0 (exclusively).
- Parameters:
minConfidence- the minConfidence value to set
-
getAnnotationText
public String getAnnotationText()
Get the annotation text property.- Returns:
- annotation text
-
setAnnotationText
public void setAnnotationText(String annotationText)
The text provided will be added as an annotation to the output PMML model. This can be used to tag a model for later reference. This is opaque text added to the annotation element within the model.- Parameters:
annotationText- annotation text
-
getModel
public PMMLPort getModel()
Get the output port containing the generated PMML-based association model.- Returns:
- output model port
-
getItemSets
public RecordPort getItemSets()
Get the output port containing the frequent item sets.- Returns:
- output port containing frequent item sets
-
getInput
public RecordPort getInput()
Get the input port that should contain transactions.- Specified by:
getInputin interfaceRecordSinkOperator- Specified by:
getInputin interfaceSinkOperator<RecordPort>- Returns:
- transaction input port
-
compose
protected void compose(CompositionContext ctx)
Description copied from class:CompositeOperatorCompose the body of this operator. Implementations should do the following:- Perform any validation of configuration, input types, etc
- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O) - Create necessary connections via the method
OperatorComposable.connect(P, P). This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
- Specified by:
composein classCompositeOperator- Parameters:
ctx- the context
-
-