# Google Cloud Recommendation Engine V1beta1 Client - Class FeatureMap (0.9.3)

0.9.3 (latest) 0.9.2 0.8.2 0.7.7 0.6.4 0.5.0 0.4.12

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

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`

## Namespace

Google \\ Cloud \\ RecommendationEngine \\ V1beta1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ categorical_features` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` 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` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` 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"]}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setCategoricalFeatures

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"]}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNumericalFeatures

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]} }`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setNumericalFeatures

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]} }`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |