# Cloud AutoML V1 Client - Class ConfusionMatrix (2.1.3)

2.1.3 (latest) 2.1.2 2.0.5 1.6.5 1.5.4 1.4.17 Reference documentation and code samples for the Cloud AutoML V1 Client class ConfusionMatrix.

Confusion matrix of the model running the classification.

Generated from protobuf message `google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix`

## Namespace

Google \\ Cloud \\ AutoMl \\ V1 \\ ClassificationEvaluationMetrics

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ annotation_spec_id` | `string[]` Output only. IDs of the annotation specs used in the confusion matrix. For Tables CLASSIFICATION prediction_type only list of annotation_spec_display_name-s is populated. |
| `↳ display_name` | `string[]` Output only. Display name of the annotation specs used in the confusion matrix, as they were at the moment of the evaluation. For Tables CLASSIFICATION prediction_type-s, distinct values of the target column at the moment of the model evaluation are populated here. |
| `↳ row` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>` Output only. Rows in the confusion matrix. The number of rows is equal to the size of `annotation_spec_id`. `row[i].example_count[j]` is the number of examples that have ground truth of the `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by the model being evaluated. |

### getAnnotationSpecId

Output only. IDs of the annotation specs used in the confusion matrix.

For Tables CLASSIFICATION
prediction_type
only list of annotation_spec_display_name-s is populated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAnnotationSpecId

Output only. IDs of the annotation specs used in the confusion matrix.

For Tables CLASSIFICATION
prediction_type
only list of annotation_spec_display_name-s is populated.

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

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

### getDisplayName

Output only. Display name of the annotation specs used in the confusion
matrix, as they were at the moment of the evaluation. For Tables
CLASSIFICATION
prediction_type-s,
distinct values of the target column at the moment of the model
evaluation are populated here.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setDisplayName

Output only. Display name of the annotation specs used in the confusion
matrix, as they were at the moment of the evaluation. For Tables
CLASSIFICATION
prediction_type-s,
distinct values of the target column at the moment of the model
evaluation are populated here.

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

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

### getRow

Output only. Rows in the confusion matrix. The number of rows is equal to
the size of `annotation_spec_id`.

`row[i].example_count[j]` is the number of examples that have ground
truth of the `annotation_spec_id[i]` and are predicted as
`annotation_spec_id[j]` by the model being evaluated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>` |   |

### setRow

Output only. Rows in the confusion matrix. The number of rows is equal to
the size of `annotation_spec_id`.

`row[i].example_count[j]` is the number of examples that have ground
truth of the `annotation_spec_id[i]` and are predicted as
`annotation_spec_id[j]` by the model being evaluated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-automl/latest/V1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>` |

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