# A Survey of Sequential Pattern Based E-Commerce Recommendation Systems
## 2 Existing Sequential Pattern-Based E-Commerce Recommendation Systems
### Historical Clickstream-Based Recommendation: HPCRec18 [43]  
Summary of HPCRec18 System [43]: The novel recommendation system called Historical Purchase with Clickstream recommendation system (HPCRC) integrates purchase frequencies and consequential bond relationships between clicks and purchases. The term consequential bond was introduced in this HPCRec system, and originates from the concept that a customer who clicks on certain items in most cases ultimately purchases an item from their list of clicks. Processing this information enhances the user-item rating matrix in terms of both the quantity and quality aspects, thereby improving recommendations. The quality of ratings is improved by capturing the level of interest in a product that has been previously purchased by a user through the record of the normalized frequency of purchase using the unit vector method. The quantity of ratings is improved by the consequential bond between clicks and purchases for sessions without purchases. Finally, the ratings for all the original unknowns are predicted based on this enriched rating matrix using the CF algorithm. The HPCRec system can provide recommendations for infrequent users, and proves that the consequential bond with normalized frequencies is more effective at predicting user interest. An Example Application of HPCRec18 System [43]: Inputs to HPCRec system [43] are: (1) user-item rating matrix (Table 22) and the consequential table (Table 23), which shows the relationship between user clicks and purchases, and (2) the user item purchase frequency matrix (Table 24), which represents the frequency of a product purchased in the user item rating matrix. The working of the algorithm is demonstrated in the following steps. Step 1: Normalize the purchase frequency matrix using unit vector formula. The user-item purchase frequency matrix (Table 24) is formed from Table 23, where the value represents the number of times a product was purchased by a user. The purchase frequency is then normalized to a scaled value (0 to 1) to form the normalized user-item purchase frequency matrix (Table 25) using the unit vector formula shown below. \[Normalized\ r_{ui}=r_{ui}/\sqrt{r_{u1}^{2}+r_{u2}^{2}+\ldots+r_{int}^{2}}\]  
For example, if user 2 purchases (item1: 1; item2: 2; item3: 0; item4: 3), then the normalized purchase frequency of user 2 for item 2 is \(2/\sqrt{1^{2}+2^{2}+0^{2}+3^{2}}=0.53\). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Customer/** & **1** & **2** & **3** & **4** \\
**Item** & & & & \\ \hline
2 & 1 & 2 &? & 3 \\ \hline
3 & 1 &? &? &? \\ \hline \hline \end{tabular}
\end{table} 
Table 24: U-I purchase frequency. Here, \(LCSR(x,y)=LCS(x,y)/max(|x|,|y|)\) LCS(x,y) is the longest common subsequence between sequence x and sequence y, and is computed as shown below. \(LCS(X_{i},Y_{i})=\emptyset\) if i = 0 or j = 0; but \(LCS(X_{i},Y_{i})=LCS(X_{i-1},Y_{j-1})\cap X_{i}\) if \(X_{i}=y_{j}\); but \(LCS(X_{i},Y_{i})=longest(LCS(X_{i},Y_{j-1}),LCS(X_{i-1},Y_{j})\) if \(X_{i}\
eq y_{j}\), where \(max(|x|,|y|)\) is the maximum length of two sequence. Step 2: Compute clickstream sequence similarity measurement (CSSM). For each session without a purchase in the consequential table, the clickstream sequence similarity measurement (CSSM) is computed to find similar sessions with a purchase value using the longest common sub-sequence rate (LCSR), for example,  
\[LCSR(<3,5,2>,<3,5,2,3>)=\frac{(<3,5,2><3,5,2,3>)}{max(3,4)}=3/4=0.75.\]  
As there is no purchase information for session 6 in the consequential table (Table 23), the Clickstream similarity between session 6, which is <3,5,2>, and other sessions is computed, as as shown in Table 26.  
Step 3: Form a weighted transaction table (Table 27) using the similarity as weight and purchases as transaction records. Step 4: Call the TWFI (Transaction-based Weighted Frequent Item) function. This takes a weighted transaction table in which weights are assigned to each transaction as input and returns items with weighted support within the given threshold.