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
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompose the body of this operator.Get the annotation text property.getInput()Get the input port that should contain transactions.Get the item field name property.Get the output port containing the frequent item sets.intgetK()Get the item-set cardinality property.Get the optional label field name property.doubleGet the minimum confidence property.doubleGet the minimum support property.getModel()Get the output port containing the generated PMML-based association model.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, notifyErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
Constructor Details
-
FPGrowth
public FPGrowth()
-
-
Method Details
-
getTxnFieldName
Get the transaction identifier field name property.- Returns:
- transaction field name
-
setTxnFieldName
Set the transaction identifier field name property.- Parameters:
txnFieldName- transaction field name
-
getItemFieldName
Get the item field name property.- Returns:
- item field name
-
setItemFieldName
Set the item field name property.- Parameters:
itemFieldName- item field name
-
getLabelFieldName
Get the optional label field name property.- Returns:
- label field name
-
setLabelFieldName
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
Get the annotation text property.- Returns:
- annotation text
-
setAnnotationText
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
Get the output port containing the generated PMML-based association model.- Returns:
- output model port
-
getItemSets
Get the output port containing the frequent item sets.- Returns:
- output port containing frequent item sets
-
getInput
Get the input port that should contain transactions.- Specified by:
getInputin interfaceRecordSinkOperator- Specified by:
getInputin interfaceSinkOperator<RecordPort>- Returns:
- transaction input port
-
compose
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
-