REDUCING SAMPLE SELECTION BIAS IN A MACHINE LEARNING-BASED RECOMMENDER SYSTEM
20230036964 · 2023-02-02
Inventors
Cpc classification
International classification
Abstract
The present disclosure relates to improving recommendations for small shops on an ecommerce platform while maintaining accuracy for larger shops. The improvement is achieved by retraining a machine-learning recommendation model to reduce sample selection bias using a meta-learning process. The retraining process comprises identifying a sample subset of shops on the ecommerce platform, where the sample batch includes shops in both a small size category and shops in a large size category. The machine-learning model is then used to make shop-specific user-item interaction predictions for each shop in the sample batch. A shop-specific loss is calculated for each shop based on the model's predicted user-item interactions for the shop-specific training dataset and the actual user-item interactions in the shop-specific training dataset. A global loss is calculated based on each of the shop-specific losses, and the baseline model is updated to minimize the global loss.
Claims
1. A machine-learning method, performed by a computer system, for predicting user-item interaction values on an ecommerce platform that includes products from different shops with different sales volumes, the method comprising: performing the following with respect to a training phase: obtaining a machine-learning model for predicting user-item interactions, wherein the model was previously trained to predict user-item interactions based on user and item data on an ecommerce platform that includes different shops with different sales volumes; modifying the model to reduce sample selection bias in favor of shops with larger sales volumes by performing the following: (b) identifying a sample batch of shops on the ecommerce platform; (b) obtaining a shop-specific training dataset for each shop, wherein each shop-specific training set has item data for items in the shop and user data including user-item interaction data for items in the shop; (c) for each shop in the sample batch, performing the following: applying the model to user and item data in the shop-specific training set for to obtain predicted user and item interactions for the shop; calculating a shop-specific loss between the predicted user and item interactions and the actual user and item interactions in the shop-specific training set; and (d) calculating a global loss based on the shop-specific losses; (e) calculating a global parameter adjustment for the model to reduce the global loss; (f) creating an updated model by adjusting the parameters of the model using the global parameter adjustment; and (g) repeating steps (c)-(f) for a number of iterations, wherein the updated model in a previous iteration becomes the model in the next iteration; performing the following with respect to a prediction phase: using the updated model to obtain user-item interaction value predictions on the ecommerce platform with respect to user and item pairs for which no interaction value is known.
2. The method of claim 1, wherein the global parameter adjustment is calculated using gradient descent and the global parameter adjustment is a gradient step.
3. The method of claim 1, further comprising: recommending one or more test users to a shop based on predicted interaction values for an item sold by the shop on the ecommerce platform and each of a plurality of test users.
4. The method of claim 1, further comprising: recommending one or more items to a test user based on predicted interaction values for the test user and each of a plurality of items on the ecommerce platform.
5. A method, performed by a computer system, for training a model to predict user-item interaction values on an ecommerce platform that includes products from different shops with different sales volumes, the method comprising: performing the following with respect to a training phase: obtaining a machine-learning model for predicting user-item interactions, wherein the model was previously trained to predict user-item interactions based on user and item data on an ecommerce platform that includes different shops with different sales volumes; modifying the model to reduce sample selection bias in favor of shops with larger sales volumes by performing the following: (a) identifying a sample batch of shops on the ecommerce platform; (b) obtaining a shop-specific training dataset for each shop, wherein each shop-specific training set has item data for items in the shop and user data including user-item interaction data for items in the shop; (c) for each shop in the sample batch, performing the following: applying the model to user and item data in the shop-specific training set for to obtain predicted user and item interactions for the shop; calculating a shop-specific loss between the predicted user and item interactions and the actual user and item interactions in the shop-specific training set; and (d) calculating a global loss based on the shop-specific losses; (e) calculating a global parameter adjustment for the model to reduce the global loss; (f) creating an updated model by adjusting the parameters of the model using the global parameter adjustment; and (g) repeating steps (c)-(f) for a number of iterations, wherein the updated model in a previous iteration becomes the model in the next iteration.
6. The method of claim 5, wherein the global parameter adjustment is calculated using gradient descent and the global parameter adjustment is a gradient step.
7. A system for predicting user-item interaction values on an ecommerce platform that includes products from different shops with different sales volumes, the system comprising: a processor configured to execute instructions programmed using a set of machine codes; one or more memory units coupled to the processor; and a machine-learning model, stored in the one or more memory units of the system, that takes a user input and an item input and outputs a user-interaction score corresponding to a predicted user-interaction value for users and items on the ecommerce platform, wherein the model includes computational instructions implemented in the machine code for generating the output, and wherein the model is trained according to a method that comprises the following: (a) identifying a sample batch of shops on the ecommerce platform; (b) obtaining a shop-specific training dataset for each shop, wherein each shop-specific training set has item data for items in the shop and user data including user-item interaction data for items in the shop; (c) for each shop in the sample batch, performing the following: applying the model to user and item data in the shop-specific training set for to obtain predicted user and item interactions for the shop; calculating a shop-specific loss between the predicted user and item interactions and the actual user and item interactions in the shop-specific training set; and (d) calculating a global loss based on the shop-specific losses; (e) calculating a global parameter adjustment for the model to reduce the global loss; (f) creating an updated model by adjusting the parameters of the model using the global parameter adjustment; and (g) repeating steps (c)-(f) for a number of iterations, wherein the updated model in a previous iteration becomes the model in the next iteration;
8. The system of claim 7, wherein the model includes the following: a concatenation module for receiving the user and item input and concatenating the user and item input; and a neural network encoder that receives the concatenated user and item input and outputs the user-item interaction score.
9. The system of claim 7, wherein the model includes the following: an item neural network encoder for receiving the item data and outputting an item feature representation; and a user neural network encoder for receiving the user data and outputting a user feature representation; wherein the user-item interaction score is generated by taking the dot product of the user and item feature representations.
10. The system of claim 7, wherein the global parameter adjustments are calculated using gradient descent global parameter adjustment is a gradient step.
11. A non-transitory computer-readable medium comprising a computer program, that, when executed by a computer system, enables the computer system to perform the following method for predicting user-item interaction values on an ecommerce platform that includes products from different shops with different sales volumes, the method comprising: performing the following with respect to a training phase: obtaining a machine-learning model for predicting user-item interactions, wherein the model was previously trained to predict user-item interactions based on user and item data on an ecommerce platform that includes different shops with different sales volumes; modifying the model to reduce sample selection bias in favor of shops with larger sales volumes by performing the following: (a) identifying a sample batch of shops on the ecommerce platform; (b) obtaining a shop-specific training dataset for each shop, wherein each shop-specific training set has item data for items in the shop and user data including user-item interaction data for items in the shop; (c) for each shop in the sample batch, performing the following: applying the model to user and item data in the shop-specific training set for to obtain predicted user and item interactions for the shop; calculating a shop-specific loss between the predicted user and item interactions and the actual user and item interactions in the shop-specific training set; and (d) calculating a global loss based on the shop-specific losses; (e) calculating a global parameter adjustment for the model to reduce the global loss; (f) creating an updated model by adjusting the parameters of the model using the global parameter adjustment; and (g) repeating steps (c)-(f) for a number of iterations, wherein the updated model in a previous iteration becomes the model in the next iteration; performing the following with respect to a prediction phase: using the updated model to obtain user-item interaction value predictions on the ecommerce platform with respect to user and item pairs for which no interaction value is known.
12. The non-transitory computer-readable medium of claim 11, further comprising: recommending one or more test users to a shop based on predicted interaction values for an item sold by the shop on the ecommerce platform and each of a plurality of test users.
13. The non-transitory computer-readable medium of claim 11, further comprising: recommending one or more items to a test user based on predicted interaction values for the test user and each of a plurality of items on the ecommerce platform.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0017]
[0018]
[0019]
[0020]
[0021]
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0022] The present disclosure relates to a machine learning-based recommender system and method for predicting user-item interactions on an ecommerce platform that includes shops with different sales volumes. Specifically, the disclosure relates to an improved recommender system with better predictions for small shops while still maintaining prediction accuracy for larger shops. The improvement is achieved by retraining the recommender system to reduce sample selection bias using a meta-learning process. The methods disclosed herein are performed by a computer system (“the system”).
[0023] We define small/large shops based on the number of sales on the applicable ecommerce platform during a period of time relative to a threshold. Specifically, the terms “small shop” and “smaller shop” refers herein to shops with a sales volume below a certain threshold. Conversely, the terms “large shop,” “larger shop” and “largest shops” refers to shops with a sales volume above a certain threshold. The invention is not dependent or limited to any particular threshold or range of thresholds. The threshold that defines small and large shops may depend on the particular ecommerce platform at issue and may be different for each ecommerce platform. However, as example, the threshold may be the median shop sales volume for all shops on the ecommerce platform during a period of time, such as the past 12 months.
[0024] Both a training phase and a prediction phase are described below for the recommender system.
[0025] 1. Training Phase
[0026]
[0027] The system retrains the baseline model to reduce the sample selection bias (step 120). Retraining the model involves identifying a sample batch of shops on the ecommerce platform (step 120a). The sample batch is a subset of shops on the platform, and it includes shops in the small size category and shops in the large size category.
[0028] The system obtains a shop-specific training dataset for each of the shops in the sample batch (step 120b). Each shop-specific training dataset includes: (1) item data for items in the shop, and (2) user data, including user-item interaction data for users in the training dataset and items in the shop. Examples of user-item interaction data include user ratings or purchase history (i.e., whether or not a user has purchased an item).
[0029] The system performs the retraining method depicted in
[0030] 1.1 Retraining Method
[0031]
[0032] 1.1.1 Calculating Shop-Specific Losses for the Model
[0033] The retraining steps described in this section are performed for each shop in the sample batch. The system applies the model (200) to user and item data in a shop-specific training dataset (210). The shop-specific training dataset includes user and item interaction data for users in the training dataset and items sold by the shop. The model generates user and item interaction predictions (220) for user-item pairs in the shop-specific training dataset. In other words, the model generates predictions for the shop. During the first iteration of the retraining method, the model 200 is the baseline model. In subsequent iterations, the model 200 is an updated version of the baseline model.
[0034] The system calculates a shop-specific loss (230) for the shop based on the predicted user and item interactions and the actual user and item interactions in the shop-specific training dataset. In one embodiment, mean square error is used as the loss function.
[0035] Since the sample batch includes both large and small shops, system has shop-specific losses for both small and large shops. As discussed below, the next part of the retraining method comprises using the shop-specific losses to calculate a global parameter adjustment.
[0036] 1.1.2 Using the Shop-Specific Losses to Calculate a Global Parameter Adjustment.
[0037] The system calculates a global loss (240) based on all the shop-specific losses. In one embodiment, the global loss is calculated as an average of the shop specific losses. The system then calculates a global parameter adjustment (250) for the model to reduce the global loss. The system creates an updated model by adjusting the parameters of the model using the global parameter adjustment. In one embodiment, the global parameter adjustment is calculated using gradient descent, and the global parameter adjustment is a gradient step.
[0038] Because the global loss is a function of the shop-specific losses, the losses from small shop predictions plays a larger role in the global parameter adjustment then training methods that directly calculate an overall loss for all shops in the training dataset and do not first calculate shop-specific losses. This improves the prediction capability of retrained model with respect to small shops. Because the sample batch also includes large shops, the retrained model retains its prediction accuracy for large shops. The system repeats the retraining method for a number of iterations, wherein the updated model in the previous iteration becomes the model in the next iteration.
[0039] 1.1.3 Mathematical Expression of Retraining Process
[0040] Below is a mathematical expression of the retraining method, according to one embodiment.
TABLE-US-00001 Algorithm 1: Meta-Shop Training Result: θ Initialization of θ, stepsize β ; while not converge do Sample batch of shops from
.sub.shop; for shop p in
do Set θ.sup.P = θ; Sample
.sub.Q.sup.P from
.sup.P; Compute shop-specific loss
.sup.P;
.sup. P ←
(
.sub.Q.sup.P; θ.sup.P) end global update θ: θ ← θ − β
∇.sub.θ
.sup.P; end
[0041] In the algorithm above:
[0042] θ is the global recommendation model g's parameter;
[0043] θ.sup.p is the shop-specific recommendation model's parameter;
[0044] D.sub.Q.sup.P is the sampled dataset for shop p;
[0045] β is learning rates;
[0046] ∇ is a gradient step; and
[0047] is the loss function
[0048]
[0049] In one embodiment, the loss function is defined as (D.sup.p, θ)=loss (y, ŷ), where y is the actual purchase label (0 for not purchase, 1 for purchase) and ŷ=g.sub.θ(f.sub.u, f.sub.i) is the predicted label, where f.sub.u, f.sub.i are user feature and item feature, respectively, which, in one embodiment, are trainable one-hot embeddings.
[0050] 2. Prediction Phase
[0051] In a prediction phase, the retrained model can be used either to recommend users to shops for targeted advertisements or to recommend items to users on the ecommerce platform.
[0052]
[0053]
3. Example Model Architecture
[0054]
[0055] In
[0056] In one embodiment, the input user data includes user-item interaction data. It may also include “side information” about a user (e.g., user demographics, such as user age, location, etc.). In one embodiment, the item data includes item “side information” which is information about the item (e.g., product category and subcategories).
[0057] In one embodiment, each of the user and item neural network encoders has a plurality of hidden layers. Each layer is associated with a weight matrix and an activation function. Making global parameter adjustments includes adjusting one or more weight matrices in the user and item neural network encoder layers.
4. Example System Architecture
[0058]
[0059] 5. General
[0060] The methods described with respect to