IBM Streams 4.2.1

Operator Associations

Primitive operator image not displayed. Problem loading file: ../../image/tk$com.ibm.streams.mining/op$com.ibm.streams.mining.scoring$Associations.svg

Association rules are represented as [x] => [y] where [x] is the rule body or antecedent, and [y] is the rule head or consequent. The Associations operator identifies the rule that applies, the rule head (consequent), and the statistical properties support and confidence of that rule for each tuple in the input stream. It then automatically assigns those values to output stream attributes. To accommodate those values, the output stream schema must contain four attributes that do not have an explicit assignment in the output attributes section and do not have the same name as that of an input stream attribute. The data types of these attributes must be int64, rstring, float64, and float64. The attributes can be located anywhere in the output schema. The support value is always assigned to the first float64 attribute, and the confidence value is always assigned to the second float64 attribute.

The Associations operator is declared as follows:
stream <stream-schema> stream-name = Associations(){
  param
    model : "<PMML-document-filename>" ;
    <mapping-parameter_1> : <output-attribute-expr_1>;
    ...
   <mapping-parameter_n> : <output-attribute-expr_n>;
}

An example of the Associations operator is as follows:

stream <rstring trans_id, int32 item_id, int64 rule_id, 
rstring head, float64 support, float64 confidence>
resultAssociations = Associations (data){
  param
    model : "../models/assoc.pmml";
    itemid : "ITEMID";
}

In the example above, the rule is assigned to output stream attribute rule_id, the items on the right side of the rule are assigned to output stream attribute head, the property support is assigned to output stream attribute support, and the property confidence is assigned to output stream attribute confidence.

Behavior in a consistent region

  • Use of this operator in a consistent is not supported. If the operator is in a consistent region, it emits a warning when you compile the streams processing application.
  • The operator does not support checkpoint and reset. Therefore, the operator might produce incorrect results when the application fails.

Summary

Ports
This operator has 2 input ports and 1 output port.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports arbitrary parameters in addition to 1 specific parameter.

Required: model

Metrics
This operator does not report any metrics.

Properties

Implementation
C++
Threading
Always - Operator always provides a single threaded execution context.

Input Ports

Ports (0)
Properties

Ports (1)
Properties

Output Ports

Assignments
This operator requires that assignments made to output attributes be input stream attributes.
Ports (0)

Properties

Parameters

This operator supports arbitrary parameters in addition to 1 specific parameter.

Required: model

model

This mandatory parameter specifies the path name of a file that contains the PMML mining model that is used for scoring the data stream. The path name can be either absolute or relative. If it is relative, the path name is rooted in the data subdirectory of the directory where the application source code file is located. This file must be readable by both the SPL compiler at compile time and by IBM InfoSphere Streams at run time. It must contain a valid PMML document for the operator type.

Properties

Libraries

No description for library.
Command: ../../Common/DmsLibInfo.pl