public sealed class FeatureMap : IMessage<FeatureMap>, IEquatable<FeatureMap>, IDeepCloneable<FeatureMap>, IBufferMessage, IMessage
Reference documentation and code samples for the Recommendations AI v1beta1 API class FeatureMap.
FeatureMap represents extra features that customers want to include in the
recommendation model for catalogs/user events as categorical/numerical
features.
public MapField<string, FeatureMap.Types.StringList> CategoricalFeatures { get; }
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."],[[["\u003cp\u003eThe \u003ccode\u003eFeatureMap\u003c/code\u003e class in the Google Cloud Recommendation Engine v1beta1 API allows for the inclusion of extra features in recommendation models for catalogs and user events.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFeatureMap\u003c/code\u003e supports both categorical and numerical features, enabling the representation of data like product brand, customer country, product dimensions, or customer age.\u003c/p\u003e\n"],["\u003cp\u003eThe class is implemented as part of a hierarchy that inherits from \u003ccode\u003eobject\u003c/code\u003e and implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFeatureMap\u003c/code\u003e includes properties for \u003ccode\u003eCategoricalFeatures\u003c/code\u003e, which are stored in a map of string keys to \u003ccode\u003eStringList\u003c/code\u003e values, and \u003ccode\u003eNumericalFeatures\u003c/code\u003e, stored as a map of string keys to \u003ccode\u003eFloatList\u003c/code\u003e values.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFeatureMap\u003c/code\u003e class offers two constructors: a default constructor \u003ccode\u003eFeatureMap()\u003c/code\u003e and an overload \u003ccode\u003eFeatureMap(FeatureMap other)\u003c/code\u003e that clones an existing \u003ccode\u003eFeatureMap\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# Recommendations AI v1beta1 API - Class FeatureMap (2.0.0-beta06)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0-beta06 (latest)](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.FeatureMap)\n- [2.0.0-beta05](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/2.0.0-beta05/Google.Cloud.RecommendationEngine.V1Beta1.FeatureMap)\n- [1.0.0-beta03](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/1.0.0-beta03/Google.Cloud.RecommendationEngine.V1Beta1.FeatureMap) \n\n public sealed class FeatureMap : IMessage\u003cFeatureMap\u003e, IEquatable\u003cFeatureMap\u003e, IDeepCloneable\u003cFeatureMap\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Recommendations AI v1beta1 API 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\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e FeatureMap \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[FeatureMap](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.FeatureMap), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[FeatureMap](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.FeatureMap), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[FeatureMap](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1.FeatureMap), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.RecommendationEngine.V1Beta1](/dotnet/docs/reference/Google.Cloud.RecommendationEngine.V1Beta1/latest/Google.Cloud.RecommendationEngine.V1Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.RecommendationEngine.V1Beta1.dll\n\nConstructors\n------------\n\n### FeatureMap()\n\n public FeatureMap()\n\n### FeatureMap(FeatureMap)\n\n public FeatureMap(FeatureMap other)\n\nProperties\n----------\n\n### CategoricalFeatures\n\n public MapField\u003cstring, FeatureMap.Types.StringList\u003e CategoricalFeatures { get; }\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.\n\nFor example: `{ \"colors\": {\"value\": [\"yellow\", \"green\"]},\n\"sizes\": {\"value\":[\"S\", \"M\"]}`\n\n### NumericalFeatures\n\n public MapField\u003cstring, FeatureMap.Types.FloatList\u003e NumericalFeatures { get; }\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.\n\nFor example: `{ \"lengths_cm\": {\"value\":[2.3, 15.4]},\n\"heights_cm\": {\"value\":[8.1, 6.4]} }`"]]