All Products
Search
Document Center

Platform For AI:Implement recommendation recall with FM-Embedding

Last Updated:Jun 20, 2026

In recommendation scenarios, use the FM-Embedding solution in Designer to obtain user and item feature vectors. In the recall module, calculate the dot product of these feature vectors to predict the rating for a user-item pair. This topic describes how to use the Factorization Machine (FM) algorithm and an embedding extraction algorithm to quickly generate user and item feature vectors.

Prerequisites

Background

A recommendation system typically includes recall and sorting modules. In the recall module, vectors represent users and items (the content to be recommended). The dot product of a user vector and an item vector indicates the user's level of interest in the item. This pipeline is based on real-world recommendation data, and its complete business workflow is pre-configured in aDesigner template. This lets you generate user and item feature vectors by dragging and dropping components.

Dataset

The source data includes the following fields.

Parameter

Type

Description

userid

STRING

The user ID.

age

DOUBLE

The user's age.

gender

STRING

The user's gender.

itemid

STRING

The item ID.

price

DOUBLE

The item price.

size

DOUBLE

The item size.

label

DOUBLE

The target column. Valid values:

  • 1.0: indicates a purchase.

  • 0.0: indicates no purchase.

Procedure

  1. Go to the Machine Learning Designer page.

    1. Log on to the PAI console.

    2. In the left-side navigation pane, click Workspaces. On the Workspaces page, click the name of the workspace that you want to manage.

    3. In the left-side navigation pane, choose Model Training > Visualized Modeling (Designer).

  2. Build a pipeline.

    1. On the Designer page, click the Preset Templates tab.

    2. In the template list, clickCreateunderCreate.

    3. In the Create Pipeline dialog box, configure the parameters. You can use the default settings for all parameters.

      The Data Storage parameter specifies an OSS Bucket path to store temporary data and models generated during the pipeline run.

    4. Click Confirm.

      It takes about 10 seconds to create the pipeline.

    5. The system automatically builds the pipeline based on the preset template, as shown in the following figure.

      推荐召回实验

      Section

      Description

      Performs one-hot encoding on all features. one-hot encoding converts string data into numerical data. In this pipeline, theOne-hot Encoding-1component first encodes the full dataset and then passes the generated model to theOne-hot Encoding-2andOne-hot Encoding-3components.

      Generates a Factorization Machine (FM) model. You can click this component and view the default parameters on theParameterstab. The third parameter ofDimensions(default value:1,1,10) specifies the dimension of the generated embedding, which is10.

      Generates user feature encoding. The inputs for theSelect Binarize Columnsparameter areuserid,gender, andage. The input for theAppended Columnsparameter isuserid.

      Generates item feature encoding. The inputs for theSelect Binarize Columnsparameter areitemid,price, andsize. The input for theAppended Columnsparameter isitemid.

      Extracts the item embedding. The parameters for this component are as follows:

      • Embedding Vector ID Column: Thefeature_idfrom the trained FM model.

      • Embedding Vector Column: Thefeature_weightsfrom the trained FM model.

      • Weight Vector Column: The sparse data column from the one-hot encoding.

      • Output Column Name: The field name for the output embedding.

  3. Run the pipeline and view the results.

    1. Click theimage.pngbutton at the top of the canvas.

    2. After the pipeline run is complete, right-click theEmbedding Extraction-1component on the canvas and chooseView Data > Outputto view the user feature vectors. The user feature vector table contains three columns:userid(user ID),kv(key-value features, for example, 10:1,7:1,37:1), andembedding(a high-dimensional vector consisting of space-separated floating-point numbers).

    3. Right-click theEmbedding Extraction-2component on the canvas and chooseView Data > Outputto view the item feature vectors. The item feature vector table contains three columns:itemid(item identifier, for example, A to J),kv(sparse feature encoding, for example, 31;1,11;1,27:1), andembedding(a multi-dimensional floating-point vector).