Mining frequent sequential patterns with cSPADE
One of the most famous frequent sequential pattern mining algorithms is the SPADE (Sequential PAttern Discovery using Equivalence classes) algorithm, which employs characteristics of the vertical database to perform intersection on ID-list with efficient lattice search and allows us to place constraints on mined sequences. In this recipe, we will demonstrate how to use cSPADE to mine frequent sequential patterns.
Getting ready
In this recipe, one has to have completed the previous recipe by generating transactions with temporal information and have it stored in a variable named traffic.tran
.
How to do it…
Please perform the following steps to mine frequent sequential patterns:
- First, use the
cspade
function to generate frequent sequential patterns:> frequent_pattern <-cspade(traffic.tran,parameter = list(support = 0.50)) > inspect(frequent_pattern) items support 1 <{item=/}> ...