|
Algorithm 1 The core code of PrefixSpan+ |
|
Input: Sequence dataset S, Threshold of support degree min_sup |
|
Output: The set of frequent sequential pattern FS |
| 1: |
Scan S, count the support number of all the items with length = 1, and delete the items from S, of which the support degree is less than min_sup, then obtain S’. The set of length-1 sequential pattern P contains all the items that are satisfied with the required support degree. |
| 2: |
FS = P |
| 3: |
Extension(S’, P)
|
| 4: |
For each , construct CMAP for from S’ |
| 5: |
if
|
| 6: |
return FS |
| 7: |
else
|
| 8: |
if
, traverse
|
| 9: |
extend all the items in to by i-extension, and obtain
|
| 10: |
if
, traverse
|
| 11: |
extend all the items in to by s-extension, and obtain
|
| 12: |
// Property 3 |
| 13: |
,
|
| 14: |
Extension(S’, P’)
|