Retail Product Recommendation with Negative Implicit Feedback

Posted on Sat, May 15, 2021
Retail Product Recommendation with Negative Implicit Feedback

A tutorial to demonstrate the process of training and evaluating various recommender models on a online retail store data. Along with the positive feedbacks like view, add-to-cart, we also have a negative event 'remove-from-cart'. The complete tutorial (+code) can be found here. In e-commerce, the number of products in the shelf space are practically infinite.

A tutorial to demonstrate the process of training and evaluating various recommender models on a online retail store data. Along with the positive feedbacks like view, add-to-cart, we also have a negative event ‘remove-from-cart’.

The complete tutorial (+code) can be found here.

In e-commerce, the number of products in the shelf space are practically infinite. Thus, the users have to navigate through a plethora of options in any category before making a purchase and they often get disinterested in the process soon. E-commerce recommendation algorithms often operate in a challenging environment. For example:

An essential characteristic in many e-commerce settings is that website visitors can have very specific short-term shopping goals when they browse the site. Relying solely on long-term user models that are pre-trained on historical data can therefore be insufficient for a suitable next-basket recommendation. Simple “real-time” recommendation approaches based, e.g., on impersonalized co-occurrence patterns, on the other hand do not fully exploit the available information about the user’s long-term preference profile. On Amazon.com, for example, each product page contains multiple personalized recommendation lists with different purposes. They comprise complements or alternatives to the currently viewed product, remind the user of recently viewed items, or represent recommendations that should appeal to the general taste of the user. Therefore, the displayed content not only depends on the features of the currently viewed article, like the product category, but can also be influenced, e.g., by a combination of the user’s past shopping behavior (long-term preferences) and his most recent navigation actions (short-term shopping goals).

A good product recommendation engine shall easily use the below data to display a solid list of recommended products:

Problem Statement and Data

Objective is to build a recommender system using implicit feedback data of an online retail store.

User Journey

Data Snapshot

System Design

Data Transformation

Many times there are no explicit ratings or preferences given by users, that is, the interactions are usually implicit. This information may reflect users’ preference towards the items in an implicit manner.

Option 1 — Simple Count: The most simple technique is to count times of interactions between user and item for producing affinity scores.

Option 2 — Weighted Count: It is useful to consider the types of different interactions as weights in the count aggregation. For example, assuming weights of the three different types, “click”, “add”, and “purchase”, are 1, 2, and 3, respectively.

Option 3 — Time-dependent Count: In many scenarios, time dependency plays a critical role in preparing dataset for building a collaborative filtering model that captures user interests drift over time. One of the common techniques for achieving time dependent count is to add a time decay factor in the counting.

Train Test Split

Option 1 — Random Split: Random split simply takes in a data set and outputs the splits of the data, given the split ratios

Option 2 — Chronological split: Chronologically splitting method takes in a dataset and splits it on timestamp

Evaluation Metrics

Model Comparison

Deployment

As medium still doesn’t support Jupyter notebooks in its native form, so we started using fastpages to share notebook based tutorials on GitHub hosted pages. The complete tutorial (+code) can be found here.