Reference documentation and code samples for the Google Cloud Recommendation Engine V1beta1 Client class FeatureMap.
FeatureMap represents extra features that customers want to include in the
recommendation model for catalogs/user events as categorical/numerical
features.
Generated from protobuf message google.cloud.recommendationengine.v1beta1.FeatureMap
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"]}
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]} }
getCategoricalFeatures
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"]}
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"]}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Google Cloud Recommendation Engine V1beta1 Client - Class FeatureMap (0.8.2)\n\nVersion latestkeyboard_arrow_down\n\n- [0.8.2 (latest)](/php/docs/reference/cloud-recommendations-ai/latest/V1beta1.FeatureMap)\n- [0.8.1](/php/docs/reference/cloud-recommendations-ai/0.8.1/V1beta1.FeatureMap)\n- [0.7.7](/php/docs/reference/cloud-recommendations-ai/0.7.7/V1beta1.FeatureMap)\n- [0.6.4](/php/docs/reference/cloud-recommendations-ai/0.6.4/V1beta1.FeatureMap)\n- [0.5.0](/php/docs/reference/cloud-recommendations-ai/0.5.0/V1beta1.FeatureMap)\n- [0.4.12](/php/docs/reference/cloud-recommendations-ai/0.4.12/V1beta1.FeatureMap) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Google Cloud Recommendation Engine V1beta1 Client class FeatureMap.\n\nFeatureMap represents extra features that customers want to include in the\nrecommendation model for catalogs/user events as categorical/numerical\nfeatures.\n\nGenerated from protobuf message `google.cloud.recommendationengine.v1beta1.FeatureMap`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ RecommendationEngine \\\\ V1beta1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getCategoricalFeatures\n\nCategorical features that can take on one of a limited number of possible\nvalues. Some examples would be the brand/maker of a product, or country of\na customer.\n\nFeature names and values must be UTF-8 encoded strings.\nFor example: `{ \"colors\": {\"value\": [\"yellow\", \"green\"]},\n\"sizes\": {\"value\":[\"S\", \"M\"]}`\n\n### setCategoricalFeatures\n\nCategorical features that can take on one of a limited number of possible\nvalues. Some examples would be the brand/maker of a product, or country of\na customer.\n\nFeature names and values must be UTF-8 encoded strings.\nFor example: `{ \"colors\": {\"value\": [\"yellow\", \"green\"]},\n\"sizes\": {\"value\":[\"S\", \"M\"]}`\n\n### getNumericalFeatures\n\nNumerical features. Some examples would be the height/weight of a product,\nor age of a customer.\n\nFeature names must be UTF-8 encoded strings.\nFor example: `{ \"lengths_cm\": {\"value\":[2.3, 15.4]},\n\"heights_cm\": {\"value\":[8.1, 6.4]} }`\n\n### setNumericalFeatures\n\nNumerical features. Some examples would be the height/weight of a product,\nor age of a customer.\n\nFeature names must be UTF-8 encoded strings.\nFor example: `{ \"lengths_cm\": {\"value\":[2.3, 15.4]},\n\"heights_cm\": {\"value\":[8.1, 6.4]} }`"]]