# A Flexible Session-Based Recommender System for e-Commerce
## 4 Results and Discussion
### Results of the Next-Item and Next-Basket Tasks  
In these experiments, 90% of dataset A was used for training and the remaining 10% for testing. A random split was repeated five times. The results reported here are the average of the results produced from each split. In the last-basket task, all available baskets were used both for training and testing. Specifically, all baskets, except for the last one, were used to train the last-basket prediction model. Then, the last basket of each user's baskets was predicted and compared to the actual last basket the user purchased.  
The post-prediction reranking was inspired by the knowledge that several product categories dominate each customer's purchases. To apply this reranking method, we define the dominant category as the one with the most \"hits\" from the session's start. Once the prevailing category is determined after each user action, all the recommended items in the dominant category are top-ranked. In the table summarizing the results, this method is indicated as \"with reranking\".  
The results of each method for the next-item (MRR) and the last-basket (F1@2) tasks are presented in Table 2. The column \"last\" shows the results if only the last item was taken as the context. The column indicated as \"all\" presents the results when the entire user behavior sequence, from the session start until the current item, is taken into account.  
The LSTM methods produced considerably better results. The MRR was 0.265 when we initialized the LSTM recommender using random weights. The embedded layer which we added improved the performance only marginally. The Doc2 Vec method was the best from the embeddings that we tested, attaining an MRR of 0.101. The Item2 Vec method performed less effectively, having an MRR of 0.087. When the content-based and the item sequence embeddings were combined, they produced better results. Finally, our experiments confirmed the intuitive assumption that category-driven reranking improves the results, except in the LSTM method. We believe this occurs because LSTMs already capture the focus on specific product categories.  
Table 3 also illustrates the results of the last-basket prediction task. Column 4 presents the Fl@2 results, considering seven previous baskets as the purchase history. Column 5 illustrates the results when all the purchases are considered. In these experiments, the results are quite different from the next-item task. In the reverse of what happens in the next-item task, the Item2 Vec method in this task performs much better than the Doc2 Vec. This is due to the smaller textual information available in the items in this dataset. Quite surprisingly, Item2 Vec outperforms the LSTM method when only seven baskets are considered; however, the performance order is marginally reversed with larger purchase history. Generally, all methods produce better results when a shorter purchase history is used. It seems that a principle of locality consistently holds which states that the next user action is influenced  
more intensively by its immediate surroundings. Another interesting result is that category-based reranking negatively affects all methods. We believe this outcome relates to the organization of the dataset which has very few categories.