- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.CompositeOperator
-
- com.pervasive.datarush.analytics.arm.FrequentItems
-
- All Implemented Interfaces:
LogicalOperator
,PipelineOperator<RecordPort>
,RecordPipelineOperator
public class FrequentItems extends CompositeOperator implements RecordPipelineOperator
Compute the frequent items within the given transactions. Two fields are needed in the input flow: one to identify transactions and another to identify items. A minimum support value must be specified as a percentage of transactions an item must participate in to be considered frequent. An optional label field may also be specified which will be used for display purposes instead of the transaction identifiers.The main output of this operator is the set of frequent items. Two fields are output, the item field from the input and the frequency count of the item.
The operator also outputs a PMML port that contains an association model. The model will be partially filled in with frequent items and transaction statistics.
-
-
Constructor Summary
Constructors Constructor Description FrequentItems()
Default constructor.FrequentItems(String txnFieldName, String itemFieldName, double minSupport)
Construct with properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose(CompositionContext ctx)
Compose the body of this operator.RecordPort
getInput()
Get the input port of this operator.String
getItemFieldName()
Get the item field name property.String
getLabelFieldName()
Get the optional label field name property.double
getMinSupport()
Get the minimum support property.PMMLPort
getModel()
Get the output PMML model port of this plan operator.RecordPort
getOutput()
Get the output port of this operator.String
getTxnFieldName()
Get the transaction field name property.void
setItemFieldName(String itemFieldName)
Set the item field name property.void
setLabelFieldName(String labelFieldName)
Set the optional label field name property.void
setMinSupport(double minSupport)
Set the minimum support property.void
setTxnFieldName(String txnFieldName)
Set the transaction 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
-
-
-
-
Constructor Detail
-
FrequentItems
public FrequentItems()
Default constructor.
-
FrequentItems
public FrequentItems(String txnFieldName, String itemFieldName, double minSupport)
Construct with properties.- Parameters:
txnFieldName
- name of the field containing the transaction identifieritemFieldName
- name of the field containing the item nameminSupport
- minimum support percentage (must be between 0 and 1)
-
-
Method Detail
-
getInput
public RecordPort getInput()
Get the input port of this operator.- Specified by:
getInput
in interfacePipelineOperator<RecordPort>
- Returns:
- input port
-
getOutput
public RecordPort getOutput()
Get the output port of this operator.- Specified by:
getOutput
in interfacePipelineOperator<RecordPort>
- Returns:
- output port
-
getModel
public PMMLPort getModel()
Get the output PMML model port of this plan operator. The PMML uses the association rules model format. Only some transaction statistics and the frequent items are captured in the model. A rule mining algorithm can add the item sets and association rules.- Returns:
- PMML model capturing frequent items
-
getTxnFieldName
public String getTxnFieldName()
Get the transaction field name property.- Returns:
- transaction field name
-
setTxnFieldName
public void setTxnFieldName(String txnFieldName)
Set the transaction 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
-
getMinSupport
public double getMinSupport()
Get the minimum support property.- Returns:
- minimum support percentage
-
setMinSupport
public void setMinSupport(double minSupport)
Set the minimum support property.- Parameters:
minSupport
- minimum support percentage
-
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
-
compose
protected void compose(CompositionContext ctx)
Description copied from class:CompositeOperator
Compose 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:
compose
in classCompositeOperator
- Parameters:
ctx
- the context
-
-