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:
- 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.
- Use the tabs on the left side of the Properties view
to navigate each operator's property pages.
- Optional: Label the operator.
- In the Properties view, click the General tab.
- 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.
- 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.
- Optional: Specify a name for the model:
- In the Properties view, click the Model Name tab.
- In the Prefix field,
type the
prefix that is used for the model that is created by the operator.
- 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.
- Optional: Specify
filter constraints.
- In the Properties
view, click the Rule Filter tab.
- On the Rule Filter page, click the Edit icon.
- 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:
- Drag
a Model Source operator for the Model Examples.Buying Behavior
on the canvas.
- Drag a Rule Filter operator on the canvas.
- Connect the output port of the Model Source operator with the
input port of the Rule Filter operator.
- Drag a Visualizer
operator on the canvas.
- Connect the output port of the Rule
Filter operator to the input
port of the Visualizer operator.
- On the canvas, select the
Rule Filter operator to display the
Properties view.
- On the General page of the Properties view,
type Filtered
buying behavior in the Label entry
field.
- On the Model name page of the Properties view:
- In
the Prefix entry field, type Examples.
- In the Model name entry field, type Filtered
Buying Behavior.
- On the Rule Filter
page of the Properties view, click the Edit icon
to display the Filters wizard:
- On the Range page of the Filters
wizard, specify the parameters
as shown in the following figure:
Figure 1. Filtering
parameters for range constraints
- 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
- 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
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.