This is the documentation for Recommendations AI, Retail Search, and the new Retail console.

Create models

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to create a new Recommendations AI model.

If you already have a recommendation model of the correct type, and you want to get predictions from it from a different location in your site, you can create a new serving configuration for it rather than creating a new model. Learn more.

Introduction

When you want to use a new recommendation type for getting predictions, you must create a new recommendation model and provide sufficient user event data for it to be trained. You create serving configurations for your new model, and when the model has finished training, request predictions from those serving configurations.

For an overview of the process of working with Retail, see Implementing a Retail solution.

Create a recommendation model

Add a new recommendation model by using the Google Cloud console. You can have up to 20 models per project, and up to 10 of them can be active (not paused) at any time. Learn more about pausing a model.

You can start up to 5 model operations per minute. Limited model operations include creation, deletion, pause, and resume.

Before you create a new model:

  • Review and choose from the available recommendation model types and model business objectives. These determine what kind of recommendations this model should be trained to provide.
  • Make sure you have enough data uploaded to meet requirements for creating a new model. Some requirements depend on the model type you choose.
  • If you plan to create a Page-Level Optimization model:

    • Check that you already have recommendation serving configs that have trained models attached to them. You must provide a selection of recommendation serving configs that Page-Level Optimization can choose from when optimizing a page's recommendations.

    • Set up event recording for detail-page-view events and events that match the page type you will deploy the Page-Level Optimization model on (for example, if you deploy the model on a home page, make sure you set up recording for home-page-view events). To improve personalized recommendations, event recording for purchase and add-to-cart events is also recommended.

    • If you choose the conversion rate (CVR) business objective, event recording for add-to-cart events is required.

    • Make sure that after creating the Page-Level Optimization model, you continue to query the model to create recommendations impressions. These impressions are used to train the Page-Level Optimization model and improve the recommendations it serves.

To create a new model:

  1. Go to the Retail Models page in the Google Cloud console.

    Go to the Models page

  2. Click Create model.

  3. Enter a name for your model.

    The name must be 1024 characters or less, and can contain only alphanumeric characters, underscores, hyphens, and spaces.

  4. Choose the recommendation type.

  5. If you selected the Page-Level Optimization model type:

    1. Choose the type of page the "Page-Level Optimization" model will optimize for you.

    2. Choose how much to restrict the serving of similar serving configs across panels:

      • Unique model type: Do not allow multiple serving configs with the same model type to be shown on different panels.

      • Unique model: Do not allow multiple serving configs with the same model to be shown on different panels.

      • Unique serving config: Do not allow the same serving config to be shown on multiple panels.

      • No restriction: Allow any serving configs to be shown on any number of panels.

    3. For each recommendation panel you plan to show with this model:

      1. Enter a panel ID.

      2. Select which serving configs the Page-Level Optimization model can consider as options for that panel.

        For example, an add-to-cart page might have a recommendation panel where you want to display either Frequently Bought Together or Others You May Like recommendations. In this case, select a serving config that uses the Frequently Bought Together model and another that uses the Others You May Like model for consideration on this panel. When you make a prediction call to the Page-Level Optimization model, it chooses which type of recommendations you should display in that panel based on the end user's event history.

      3. Select a default serving config.

        If a Google server outage occurs, the Page-Level Optimization model can still serve results from the default serving config.

      4. If you need to create additional panels, for each new panel click Add a panel and enter the new panel details.

  6. Choose the business objective, if available for the model type you selected.

  7. Review the Data requirements met? list to confirm that you have uploaded sufficient data for the model type you selected.

    If an unmet data requirement prevents you from creating the model, an X x icon appears next to the requirement and the Create button at the bottom of the Create recommendation model pane is disabled.

    If you need to upload more data, carefully review the data requirements listed to make sure whether some or all of them need to be fulfilled for that model, then import the user events or products required to create the model

    For how to import, see Import historical user events and Import catalog information.

  8. Choose how often to tune the model. For tuning cost details, see Pricing.

    • Every three months: The model automatically tunes every three months.
    • Manual tune only: The model is tuned only when you tune it manually.
  9. (Public Preview feature) Choose whether to automatically generate tags for filtering.

    • Auto generate tags: Turning on this option allows you to filter recommendations results from this model. Having this option turned on can increase training time. For training cost details, see Pricing.
    • Do not generate tags: If this option is turned off, you cannot get filtered recommendations from this model.
  10. Click Create to create the new recommendation model.

    If you have uploaded sufficient user event data of the required type, the initial model training and tuning begins. Initial model training and tuning takes 2-5 days to complete, but can take longer for large datasets.

    You can create serving configurations for your new model before training completes, but they will serve only "dry run" predictions until the initial training and tuning completes and the model becomes active.

Requirements for creating a new recommendation model

The first time you use a specific recommendation type for your site, you are training a new machine learning model, which requires sufficient training data, as well as time to train and tune the model. The following steps are required to start using a new recommendation type:

  1. Import your catalog to Retail, if you haven't already, and implement processes to keep the uploaded catalog up to date.
  2. Start recording user events to Retail, if you haven't already, making sure to follow the best practices for recording user event data.
  3. Identify the recommendation type and optimization objective you want to use.
  4. Determine the user event data requirement for your desired recommendation type and objective.
  5. Import historical user event data to meet the minimum event data requirements, or wait until the user event data collection meets the minimum requirements.
  6. Create your model and your serving configurations.

    At this point, Retail initiates model training and tuning. Initial model training and tuning takes 2-5 days to complete, but can take longer for large datasets.

  7. Confirm that your model is working correctly using prediction preview.

  8. Create your A/B experiment.

User event data requirements

The type of user events you import, and the amount of data you need, depends on your recommendation (model) type and your optimization objective. When you reach the minimum data requirement, you can begin model training.

The data collection window represents the maximum length of time the Retail API looks back for user events; importing more historical data has no effect on model quality.

Because the Retail API cannot produce good quality models based on synthetic data, make sure to use real user events and real catalog data.

Model type Optimization objective Supported user event types Minimum data requirement Data collection window
Recommended for You Click-through rate detail-page-view

add‑to‑cart

purchase-complete

home-page-view

10,000 detail-page-view events that include at least 100 unique visitor IDs and 100 unique joined products in the active branch.

10,000 home-page-view events.

AND

(1 week, with an average of 10 detail-page-view events per joined catalog item.

OR

60 days with at least one joined detail-page-view event.)

3 months
Recommended for You Conversion rate detail-page-view

add-to-cart

purchase-complete

home-page-view

10,000 add-to-cart events that include at least 100 unique visitor IDs and 100 unique joined products in the active branch.

10,000 detail-page-view events.

10,000 home-page-view events.

AND

(1 week, with an average of 10 add-to-cart events per joined catalog item.

OR

60 days with at least one joined add-to-cart event.)

3 months
Others You May Like Click-through rate detail-page-view

10,000 detail-page-view events that include at least 100 unique visitor IDs and 100 unique joined products in the active branch.

AND

(1 week, with an average of 10 detail-page-view events per joined product.

OR

60 days with at least one joined detail-page-view event.)

3 months
Others You May Like Conversion rate add-to-cart

detail-page-view

10,000 add-to-cart events that include at least 100 unique visitor IDs and 100 unique joined products in the active branch.

10,000 detail-page-view events.

AND

(1 week, with an average of 10 add-to-cart events per joined product.

OR

60 days with at least one joined add-to-cart event.)

3 months
Frequently Bought Together Any purchase-complete

detail-page-view

1000 purchase-complete events that include at least 100 unique visitor IDs.

AND

(An average of 10 purchase-complete events per joined product.

OR

90 days of purchase-complete events.)

12 months
Similar Items Click-through rate None required.

At least 100 in-stock product SKUs must be present in the active catalog branch. No user events are required.

N/A
Page-Level Optimization Any detail-page-view

add-to-cart

purchase-complete

home-page-view

Page-Level Optimization optimizes recommendation panels by choosing between several possible models. Refer to the data requirements for the models you select as options for Page-Level Optimization.

N/A
Buy it Again N/A purchase-complete

1,000 purchase-complete events that include at least 100 unique visitor IDs and 100 unique joined products in the active branch.

AND

60 days of purchase-complete events.

AND

At least 100 in-stock product SKUs must be present in the active catalog branch.

90 days

What's next