IDAX.PREDICT_SEQRULES - Apply sequential patterns to new data

Use this stored procedure to apply the sequential patterns and rules of a sequential patterns model to other transactions.

Authorities

The privileges held by the authorization ID of the statement must include the IDAX_USER role. Additionally, you must be the owner of the model or have the SELECT privilege on the source model.

Syntax

IDAX.PREDICT_SEQRULES(in parameter_string varchar(32672))

Parameter descriptions

parameter_string
Mandatory one-string parameter that contains pairs of <parameter>=<value> entries that are separated by a comma.
Data type: VARCHAR(32672)
The following list shows the parameter values:
model
Mandatory.
The name of the sequential patterns model that is to be applied.
Data type: VARCHAR(192)
intable
Mandatory.
The name of the input table.
Data type: VARCHAR(128)
outtable
Mandatory.
The name of the output table which the mapping between the input sequences and the associated rules or patterns is written to.
Data type: VARCHAR(128)
sid
Optional.
The column of the input table that identifies a sequence ID.
Default: the same sid column that is specified in the stored procedure to build the model.
Data type: VARCHAR(128)
tid
Optional.
The column of the input table that identifies a transaction of the sequence by ID or by time.
Default: the same tid column that is specified in the stored procedure to build the model.
Data type: VARCHAR(128)
item
Optional.
The column of the input table that identifies an item of the transaction.
Default: the same item column that is specified in the stored procedure to build the model.
Data type: VARCHAR(128)
type
Optional.
The type of information that is written to the output table.
Possible values are 'patterns' and 'rules'.
Default: rules
Data type: VARCHAR(8)
limit
Optional.
The maximum number of patterns or rules that is written to the output table for each input sequence.
Default: 1
Range: >=1
Data type: INTEGER
sort
Optional.
A list of keywords that indicate the order in which the rules or patterns are written to the output table. The order of the list is descending. The items are separated by semicolons.
Possible values are 'support', 'confidence', 'lift', 'length', and 'time'.
The 'confidence' value and the 'time' value can only be specified if the type parameter is 'rules'.
Default if the type parameter is 'rules': support;confidence;length
Default if the type parameter is 'patterns': support;lift;length
Data type: VARCHAR(32000)
after
Optional.
The lower limit of the predicted time for each sequential rule.
The predicted time is the time of the rule that is added to the time of the transaction of the input sequence that contains the pattern of the last transaction on the left side of the rule.
You cannot specify this parameter if the type of the parameter is patterns.
If this parameter is not specified, no limitations of time are considered.
Default: none
Data type: the same data type as the column that is specified by the tid parameter.

Returned information

The number of input sequences for which at least one pattern or rule is returned as a result set.

The result set columns are as follows:

Table 1. Result set columns for the IDAX.PREDICT_SEQRULES procedure
Column name Column type Description
Name of column as specified by the sid parameter Type of column as specified by the sid parameter The ID of the input sequence
RANK INTEGER The rank of the sequential pattern or rule that is associated with this input sequence

The order is specified by the sort parameter.

RULEID INTEGER The ID of the rule that is associated with this input sequence

The column is only shown if the type parameter is 'rules'.

SEQUENCEID INTEGER The ID of the sequence pattern that is associated with this input transaction

The column is only shown if the type parameter is 'patterns'.

PRINT VARCHAR The print form of the pattern or rule as returned by the PRINT_MODEL procedure
LENGTH INTEGER The number of items in the sequential pattern or rule
SUPPORT DOUBLE The support of the sequential pattern or rule
LIFT DOUBLE The lift of the sequential pattern or rule
CONFIDENCE DOUBLE The confidence of the rule

The column is only shown if the type parameter is 'rules'.

TIME DOUBLE or the same type as the column that is specified by the tid parameter. The predicted time when the head of the rules is to be shown

The column is only shown if the type parameter is 'rules'.

If the tid is neither numeric or of type date or time, the time is NULL.

Example

CALL IDAX.PREDICT_SEQRULES('model=retail_seqrules, intable=retail_seq, outtable=retail_seqrules_out');