Skip to content

Context-aware Retail Product Recommendation with Regularized Gradient Boosting

License

Notifications You must be signed in to change notification settings

diptamath/Context-aware-Retail-Product-Recommendation

Repository files navigation

Context-aware-Retail-Product-Recommendation with Regularized Gradient Boosting

This repository contains the codes that we used as a part of the FARFETCH Recommendation challenge. Also check the paper below(accepted for publication at ECML PKDD 2021 workshop) for detailed methodology.

Pre-print: https://arxiv.org/abs/2109.08561

Summary

Participants in the FARFETCH Fashion Recommendation challenge had to guess the sequence in which different products would be displayed to a user in a recommendation impression. Two phases—a validation phase and a test phase—were used to provide the data. A labelled training set with a binary column indicating whether or not a product had been clicked was used in the validation phase. Over 5,000,000 suggestion events, 450,000 products, and 230,000 unique users are included in the dataset. It displays the impartial, truthful interactions of real FARFETCH platform users. The final assessment was made in light of the second phase's performance. A total of 167 people took part in the challenge, and with an MRR of 0.4658 on the test set, we came in sixth place overall during the internal review. We have developed a special context-aware system that, in order to rank products more effectively, considers how closely a product relates to the user context. After review, we were able to refine our strategy, and on the test set, we had an MRR of 0.4784, which would have put us in third place.

Preprocessing

Categorical variable encoding was the primary type of data preprocessing that we needed to use for this issue. The provided dataset has many categorical columns, the majority of which have many different categories. Due to the sparsity of the data, we chose label encoding as the preferred method for categorical variable encoding over strategies like one-hot encoding.

Feature Extraction

The most crucial component of our solution is this. A correctly designed feature may have the ability to effectively describe the significance of a product within a question. We can broadly divide features into two categories: click-out features and non-click-out features. An important feature that we have included in our model is the Product-Context Similarity that enables us to take the "context-awareness" into account and generates recommendations specific to the contextual situation of an user. The codes for engineering both type of features can be found in the folder below:

Modelling Approach

Binary Classification

This method treats the task as a straightforward binary classification problem with the aim being whether a product has been clicked or not, that is, whether click is a value of 0 or 1. The likelihood that the product will be clicked on is expected to range from 0 to 1, with a number closer to 1 indicating a higher likelihood. We have tried with the classifiers LightGBM and XGBOOST. In all scenarios, with and without filtering on both validation and test sets, the XGBOOST model outperforms the LightGBM model in terms of MRR. This indicates that the latter model is more effective. Binary cross-entropy is used as the objective function during model training. Using the expected probability values from the model, or the likelihood that the product would be clicked, we rank the items within a query during inference. The code to train the XGBOOST model in order to obtain the best set of parameters can be found here.

Post-Processing

We have used a context-aware post-processing technique to enhance the rating of products within an impression. In essence, we need to select a cutoff value for product-context similarity. We rank the products within an impression using the model prediction probabilities if the highest product-context similarity is less than this threshold. However, if the maximum value exceeds the threshold, we simply use the product-context similarity scores to rank the products in the impression. Using an ablation analysis of the product-context similarity column with various threshold values, the threshold value for a given dataset is chosen. Post evaluation, when the validation and test labels are available, we've seen that establishing a threshold value around 0.45 to 0.50 aidshelps us in achieving the best results. The product-context similarity computation for each product and context pair is done using this code. The code for implementation of the post-processing algorithm in order to calculate the final product rankings can be found here. The graphs show the variation of PCS threshold values on validation and test sets, that enable us choose an optimal value: alt text

Evaluation Criteria

Mean Reciprocal Rank (MRR) was the evaluation metric specified in the challenge that we needed to use in order to evaluate our models.

Results

The model performance results are shown below: alt text

About

Context-aware Retail Product Recommendation with Regularized Gradient Boosting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published