Defining Rule Filter operators

You can filter the rules of association models and sequence models by using the Rule Filter operator.

Before you begin

  • Drag a Sequences Mining operator on the canvas and connect it with a sequences model.
  • Drag a Rule Filter operator on the canvas.
  • Connect the output port of the Sequences Mining operator to the input port of the Rule Filter operator.

Procedure

To define a Rule Filter operator, complete the following steps:

  1. In the canvas, click the operator to select it. A black box highlights a selected operator. After you select an operator, the property pages for that operator appear in the Properties view beneath the canvas.
  2. Use the tabs on the left side of the Properties view to navigate each operator's property pages.
  3. Optional: Label the operator.
    1. In the Properties view, click the General tab.
    2. In the Label field, type a name for the operator that is highlighted in the data flow on the canvas.

      You can specify a name of any length. The operator is labeled with the name you specified. On the canvas, the name is truncated to 14 characters.

    3. In the Description field, you can type more details about the operator.

      The length of the description is not limited. The description is only displayed in the Properties view.

  4. Optional: Specify a name for the model:
    1. In the Properties view, click the Model Name tab.
    2. In the Prefix field, type the prefix that is used for the model that is created by the operator.
    3. In the Model name field, type the name of the model.

      The model name is used as key to look up the model in Db2® tables. If a model with the same name already exists, it is replaced with the new model.

  5. Optional: Specify filter constraints.
    1. In the Properties view, click the Rule Filter tab.
    2. On the Rule Filter page, click the Edit icon.
    3. In the dialog, click the appropriate tab to specify the range constraints, the count constraints, and the item constraints that you want to use and click OK.

      On the Rule Filter page, the specified filter constraints are displayed.

Example for filtering rules

Before you begin:

Create the sequence model Examples.Buying Behavior as described in Defining a Sequences operator, however, skip step 6 c in the instructions.

Skipping step 6 c means that you do not restrict the maximum number of rules to 50, but use the default value of 10000.

Example:

To filter the sequence model Examples.Buying Behavior, follow these steps:
  1. Drag a Model Source operator for the Model Examples.Buying Behavior on the canvas.
  2. Drag a Rule Filter operator on the canvas.
  3. Connect the output port of the Model Source operator with the input port of the Rule Filter operator.
  4. Drag a Visualizer operator on the canvas.
  5. Connect the output port of the Rule Filter operator to the input port of the Visualizer operator.
  6. On the canvas, select the Rule Filter operator to display the Properties view.
  7. On the General page of the Properties view, type Filtered buying behavior in the Label entry field.
  8. On the Model name page of the Properties view:
    1. In the Prefix entry field, type Examples.
    2. In the Model name entry field, type Filtered Buying Behavior.
  9. On the Rule Filter page of the Properties view, click the Edit icon to display the Filters wizard:
    1. On the Range page of the Filters wizard, specify the parameters as shown in the following figure:
      Figure 1. Filtering parameters for range constraints
      The figure above shows the filtering parameters for buying behavior
    2. On the Item page of the Filters wizard, specify the following expression and click OK:
      ITEMID = Cider IsIn Body 
      AND NOT ITEMID = Cream IsIn Head 
      AND NOT ITEMID = Lemonade IsIn Rule

      If you do not want to type the expression above, you can click the ITEMID column and double-click the different list-box elements to construct the expression.

      The list of constraints look like this:

      Figure 2. The list of constraints
      The figure above shows the list of constraints
  10. In the Design Studio, start the mining flow by clicking the appropriate icon on the icon bar. The following figure shows the resulting mining flow:
    Figure 3. Mining flow for filtering rules for buying behavior
    The figure above shows the mining flow for filtering rules for buying behavior

After you have filtered the rules, the visualizer shows less than 60 rules. If you do not filter the rules, the visualizer shows more than 10000 rules.



Feedback