A frequent sequence is an ordered pattern of items or events that meets a chosen frequency threshold in a dataset. Sequential mining searches for these patterns and stops when no further frequent sequences can be found. section 4.7.1
SPADE works with sequence IDs and element IDs. It combines matching sequence entries, joins shorter sequences, and extends candidates only while they remain frequent. section 4.7.1
Milk, Eggs -> Milk
For sequence ID 1001, Milk occurs at element 1, Eggs at element 2, and Milk again at element 3. The resulting three-item sequence is retained for the matching records. A Python run can mine the dataset with pycspade using support=0.6 and print the results. section 4.7.1
Table 4.13 The dataset for sequence mining
|
Sequence ID
|
Sequence
|
|---|---|
|
1001
|
<(Milk) (Milk, Eggs, Bread) (Milk, Bread) (Sugar) (Bread, Apples)>
|
|
1002
|
<(Milk, Sugar) (Bread) (Eggs, Bread) (Milk, Cheese)>
|
|
1003
|
<(Cheese, Apples) (Milk, Eggs) (Sugar, Apples) (Bread) (Eggs)>
|
|
1004
|
<(Cheese, Bananas) (Milk, Apples) (Bread) (Eggs) (Bread)>
|
Inspect the sequence dataset used to represent ordered item groups before mining. section 4.7.1
