# Google Cloud Dialogflow V2 Client - Class TopNMetrics (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class TopNMetrics.

Evaluation metrics when retrieving `n` smart replies with the model.

Generated from protobuf message `google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2 \\ SmartReplyMetrics

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ n` | `int` Number of retrieved smart replies. For example, when `n` is 3, this evaluation contains metrics for when Dialogflow retrieves 3 smart replies with the model. |
| `↳ recall` | `float` Defined as `number of queries whose top n smart replies have at least one similar (token match similarity above the defined threshold) reply as the real reply` divided by `number of queries with at least one smart reply`. Value ranges from 0.0 to 1.0 inclusive. |

### getN

Number of retrieved smart replies. For example, when `n` is 3, this
evaluation contains metrics for when Dialogflow retrieves 3 smart replies
with the model.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setN

Number of retrieved smart replies. For example, when `n` is 3, this
evaluation contains metrics for when Dialogflow retrieves 3 smart replies
with the model.

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

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

### getRecall

Defined as `number of queries whose top n smart replies have at least one
similar (token match similarity above the defined threshold) reply as the
real reply` divided by `number of queries with at least one smart reply`.

Value ranges from 0.0 to 1.0 inclusive.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setRecall

Defined as `number of queries whose top n smart replies have at least one
similar (token match similarity above the defined threshold) reply as the
real reply` divided by `number of queries with at least one smart reply`.

Value ranges from 0.0 to 1.0 inclusive.

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

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