Skip to content

Instantly share code, notes, and snippets.

@AaradhyaSaxena
Last active February 27, 2023 12:04
Show Gist options
  • Save AaradhyaSaxena/dc4ea4a35693bbf545846e8ec7f38a82 to your computer and use it in GitHub Desktop.
Save AaradhyaSaxena/dc4ea4a35693bbf545846e8ec7f38a82 to your computer and use it in GitHub Desktop.
Recommendation-Models-Google-Cloud

About recommendation models

(https://cloud.google.com/retail/docs/models)

The Retail API offers the following recommendation model types:

  • Others You May Like
  • Frequently Bought Together (shopping cart expansion)
  • Recommended for You
  • Similar Items
  • Buy it Again
  • On-sale
  • Recently Viewed
  • Page-Level Optimization

Others You May Like

The Others You May Like recommendation predicts the next product that a user is mostlikely to engage or convert with. The prediction is based on the shopping and viewing history of the user and the candidate product's relevance to a current specified product. Default optimization objective: click-through rate

  • We could use something like this on HomePage

    • Not sure how to use with Search/ Auto-suggestion
  • Can be developed using directed graphs (currently using undirected) which preserves ORDER in product interaction.

Frequently Bought Together (shopping cart expansion)

The Frequently Bought Together recommendation predicts items frequently bought together for a specific product within the same shopping session. If a list of products is being viewed, then it predicts items frequently bought with that product list. This recommendation is useful when the user has indicated an intent to purchase a particular product (or list of products) already, and you are looking to recommend complements (as opposed to substitutes). This recommendation is commonly displayed on the "add to cart" page, or on the "shopping cart" or "registry" pages (for shopping cart expansion). Default optimization objective: revenue per order

  • We could compute an order embedding (aggregating embeddings of products in cart) exclude user-history, and perform a nearest neighbor search on product similiarity index.

Recommended for You

The Recommended for You recommendation predicts the next product that a user is most likely to engage with or purchase, based on the shopping or viewing history of that user and contextual information of requests, such as timestamps. This recommendation is typically used on the home page. Default optimization objective: click-through rate

  • Perform a nearest neighbor search on product similiarity index using user-embedding.

Similar Items

The Similar Items recommendation predicts other products that have mostly similar attributes to the product being considered. This recommendation is typically used on a product detail page, or when a recommended product is out of stock.

  • Find similar products by creating separate graph using only Also-View events (with filter on category and timestamp)

Buy it Again

The Buy it Again model encourages purchasing items again based on previous recurring purchases. This personalized model predicts products that have been previously bought at least once and that are typically bought on a regular cadence. The interval at which a product is suggested depends on the product and site visitor. Recommendations from this model can be used on any page type. The Buy it Again model uses purchase-complete user events.

  • Separately store products which are bought multiple times with same user-ids. Compute interval at which it is bought globally and on user level, recommend accordingly.

Click-through rate (CTR)

Optimizing for CTR emphasizes engagement; you should optimize for CTR when you want to maximize the likelihood that the user interacts with the recommendation. CTR is the default optimization objective for the Others You May Like and Recommended for You recommendation model types.

Revenue per session

The revenue per session optimization objective is available for "Others You May Like" and "Frequently Bought Together" recommendation model types. Although objective works differently for each model, the goal is the same, to increase revenue.

  • For Others You May Like The objective combines information from clicks, conversions, and item prices to help the model recommend items that have higher prices and a higher probability of being purchased.
  • For Frequently Bought Together. This objective optimizes for recommending items with a higher probability of being added to carts, benefiting revenue with by expanding cart sizes.

Conversion rate (CVR)

Optimizing for conversion rate maximizes the likelihood that the user adds the recommended item to their cart; if you want to increase the number of items added to a cart per session, optimize for conversion rate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment