Important: There is a newer version of this product and documentation. You are currently viewing the v1beta1 Recommendations Engine API documentation, which remains available but will no longer be updated.

See Migrating to the Retail API from beta in the new documentation.

FeatureMap

FeatureMap represents extra features that customers want to include in the recommendation model for catalogs/user events as categorical/numerical features.

JSON representation
{
  "categoricalFeatures": {
    string: {
      object (StringList)
    },
    ...
  },
  "numericalFeatures": {
    string: {
      object (FloatList)
    },
    ...
  }
}
Fields
categoricalFeatures

map (key: string, value: object (StringList))

Categorical features that can take on one of a limited number of possible values. Some examples would be the brand/maker of a product, or country of a customer.

Feature names and values must be UTF-8 encoded strings.

For example: { "colors": {"value": ["yellow", "green"]}, "sizes": {"value":["S", "M"]}

numericalFeatures

map (key: string, value: object (FloatList))

Numerical features. Some examples would be the height/weight of a product, or age of a customer.

Feature names must be UTF-8 encoded strings.

For example: { "lengths_cm": {"value":[2.3, 15.4]}, "heights_cm": {"value":[8.1, 6.4]} }

StringList

A list of string features.

JSON representation
{
  "value": [
    string
  ]
}
Fields
value[]

string

String feature value with a length limit of 128 bytes.

FloatList

A list of float features.

JSON representation
{
  "value": [
    number
  ]
}
Fields
value[]

number

Float feature value.