# A Survey of Sequential Pattern Based E-Commerce Recommendation Systems
## 1 Introduction
An example of historical daily purchase data for a grocery store is shown in Table 4. It contains CustomerID, PurchasedItems for the set of purchased items by customers, and Timestamp for the time of purchase. \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**User/Item** & **Terminator** & **Deadpool** & **Mission Impossible** & **James Bond** & **Fast \& Furious** \\ \hline [PERSON] & 2 &? & 3 &? & 5 \\ \hline [PERSON] & 3 & 1 & 5 &? &? \\ \hline [PERSON] & 1 &? &? & 3 & 4 \\ \hline [PERSON] & 2 & 4 & 1 & 1 &? \\ \hline \hline \end{tabular}
\end{table} 
Table 1: A sample user’s click and purchase behavior data. \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**User Id** & **Click** & **Purchase** \\ \hline
1 & Cheese, Butter, Milk, Cream, Honey, Bread & Cream, Butter, Milk, Honey \\ \hline \hline \end{tabular}
\end{table} 
Table 2: An example movie site user–item rating matrix. \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**User/Item** & **Milk** & **Bread** & **Butter** & **Cream** & **Cheese** & **Honey** \\ \hline User 1 & 1 & 0 & 1 & 1 & 0 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: An implicit user–item purchase matrix. A sequential database can be constructed from such historical purchase data by considering a period of time (day, week, and month). In this case, the purchase sequential database from historical purchase data (Table 4) is presented in Table 5, where SID (01) contains the sequence \(<\) (Bread, Milk), (Bread, Milk, Sugar), (Milk), (Tea, Sugar)\(>\). This means that customer (01) first purchased Bread and Milk together, then purchased Bread, Milk and Sugar together in the second purchase, Milk in the third purchase, and finally Tea and Sugar together in the last purchase. Sequential patterns are ordered sets of items (events) that occur with respect to time [5]. A sequential pattern is denoted in angular brackets (\(<>\)) and each itemset contains sets of items, where each itemset enclosed in parenthesis () separated by commas represents a set of items purchased at the same time in one market visit. For example, from Table 5, \(<(\mathit{Bread}),(\mathit{Sugar},\mathit{Tea})>\) is a frequent sequential pattern if the minimum support of 75% is used in this database to mine frequent sequential patterns that have occurred up to this minimum support times in the sequential database. This means that most customers would first purchase Bread in one visit and purchase Sugar and Tea together in a subsequent purchase. Support of a sequential pattern in a database table is defined as the number of records the pattern occurred in divided by the total number of records in the databases. A Sequential Historical Database (SHOD) algorithm was used in the HSPRec system [6] to generate sequential database from historical purchase database similar to Table 4.  
The problem of SPM can now be formally described as follows. For  
1. a set of sequential records (called sequences) representing a sequential database \(\mathrm{SDB}=\{s1,s2,\ldots,sn\}\) with sequence identifiers 1, 2, 3, \(\ldots\), n,
2. a minimum support threshold, called \(\min\)\(\sup\)\(\xi\), and
3. a set of k unique candidate items or events I = \(\{\mathrm{i1},\mathrm{i2},\ldots,\mathrm{ik}\}\), SPM algorithms discover the set of all frequent subsequences S in the given sequence database SDB of items I at the given \(\min\)\(\sup\)\(\xi\) that are interesting for the user. A sequence s is said to be a frequent sequence or a sequential pattern if its support (the percentage of the total number of database records the sequence appears in) is greater than or equal to the minimum support (\(\min\)\(\sup\)\(\xi\)) [7]. The input of an e-commerce recommendation system based on a collaborative filtering approach is usually a binary user-item rating matrix (Table 6), only showing whether or not an item has been purchased or liked by a user previously.