# Google Cloud Recommendation Engine V1beta1 Client - Class PredictionResult (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 PredictionResult.

PredictionResult represents the recommendation prediction results.

Generated from protobuf message `google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult`

## Namespace

Google \\ Cloud \\ RecommendationEngine \\ V1beta1 \\ PredictResponse

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ id` | `string` ID of the recommended catalog item |
| `↳ item_metadata` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Additional item metadata / annotations. Possible values: \* \* `catalogItem`: JSON representation of the catalogItem. Will be set if `returnCatalogItem` is set to true in `PredictRequest.params`. \* \* `score`: Prediction score in double value. Will be set if `returnItemScore` is set to true in `PredictRequest.params`. |

### getId

ID of the recommended catalog item

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setId

ID of the recommended catalog item

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getItemMetadata

Additional item metadata / annotations.

Possible values:

- `catalogItem`: JSON representation of the catalogItem. Will be set if `returnCatalogItem` is set to true in `PredictRequest.params`.
- `score`: Prediction score in double value. Will be set if `returnItemScore` is set to true in `PredictRequest.params`.

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

### setItemMetadata

Additional item metadata / annotations.

Possible values:

- `catalogItem`: JSON representation of the catalogItem. Will be set if `returnCatalogItem` is set to true in `PredictRequest.params`.
- `score`: Prediction score in double value. Will be set if `returnItemScore` is set to true in `PredictRequest.params`.

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

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