# Google Cloud Ai Platform V1 Client - Class Attribution (1.60.0)

1.60.0 (latest) 1.59.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.48.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.1 1.31.0 1.30.0 1.26.0 1.23.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.1 1.12.0 1.11.0 1.10.0 1.9.0 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.39.0 0.38.0 0.37.1 0.32.0 0.31.0 0.30.0 0.29.0 0.28.0 0.27.0 0.26.2 0.25.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0 0.16.0 0.15.0 0.13.0 0.12.0 0.11.1 0.10.0 Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class Attribution.

Attribution that explains a particular prediction output.

Generated from protobuf message `google.cloud.aiplatform.v1.Attribution`

## Namespace

Google \\ Cloud \\ AIPlatform \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ baseline_output_value` | `float` Output only. Model predicted output if the input instance is constructed from the baselines of all the features defined in [ExplanationMetadata.inputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getInputs__). The field name of the output is determined by the key in [ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__). If the Model's predicted output has multiple dimensions (rank \> 1), this is the value in the output located by [output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__). If there are multiple baselines, their output values are averaged. |
| `↳ instance_output_value` | `float` Output only. Model predicted output on the corresponding explanation instance. The field name of the output is determined by the key in [ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__). If the Model predicted output has multiple dimensions, this is the value in the output located by [output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__). |
| `↳ feature_attributions` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Value` Output only. Attributions of each explained feature. Features are extracted from the [prediction instances](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplainRequest#_Google_Cloud_AIPlatform_V1_ExplainRequest__getInstances__) according to [explanation metadata for inputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getInputs__). The value is a struct, whose keys are the name of the feature. The values are how much the feature in the [instance](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplainRequest#_Google_Cloud_AIPlatform_V1_ExplainRequest__getInstances__) contributed to the predicted result. The format of the value is determined by the feature's input format: \* \* If the feature is a scalar value, the attribution value is a [floating number](https://protobuf.dev/reference/php/api-docs/floating number). \* \* If the feature is an array of scalar values, the attribution value is an [array](https://protobuf.dev/reference/php/api-docs/array). \* \* If the feature is a struct, the attribution value is a [struct](https://protobuf.dev/reference/php/api-docs/struct). The keys in the attribution value struct are the same as the keys in the feature struct. The formats of the values in the attribution struct are determined by the formats of the values in the feature struct. The [ExplanationMetadata.feature_attributions_schema_uri](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getFeatureAttributionsSchemaUri__) field, pointed to by the [ExplanationSpec](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationSpec) field of the [Endpoint.deployed_models](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Endpoint#_Google_Cloud_AIPlatform_V1_Endpoint__getDeployedModels__) object, points to the schema file that describes the features and their attribution values (if it is populated). |
| `↳ output_index` | `int[]` Output only. The index that locates the explained prediction output. If the prediction output is a scalar value, output_index is not populated. If the prediction output has multiple dimensions, the length of the output_index list is the same as the number of dimensions of the output. The i-th element in output_index is the element index of the i-th dimension of the output vector. Indices start from 0. |
| `↳ output_display_name` | `string` Output only. The display name of the output identified by [output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__). For example, the predicted class name by a multi-classification Model. This field is only populated iff the Model predicts display names as a separate field along with the explained output. The predicted display name must has the same shape of the explained output, and can be located using output_index. |
| `↳ approximation_error` | `float` Output only. Error of [feature_attributions](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getFeatureAttributions__) caused by approximation used in the explanation method. Lower value means more precise attributions. \* \* For Sampled Shapley [attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getSampledShapleyAttribution__), increasing [path_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.SampledShapleyAttribution#_Google_Cloud_AIPlatform_V1_SampledShapleyAttribution__getPathCount__) might reduce the error. \* \* For Integrated Gradients [attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getIntegratedGradientsAttribution__), increasing [step_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.IntegratedGradientsAttribution#_Google_Cloud_AIPlatform_V1_IntegratedGradientsAttribution__getStepCount__) might reduce the error. \* \* For [XRAI attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getXraiAttribution__), increasing [step_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.XraiAttribution#_Google_Cloud_AIPlatform_V1_XraiAttribution__getStepCount__) might reduce the error. See [this introduction](https://docs.cloud.google.com/vertex-ai/docs/explainable-ai/overview) for more information. |
| `↳ output_name` | `string` Output only. Name of the explain output. Specified as the key in [ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__). |

### getBaselineOutputValue

Output only. Model predicted output if the input instance is constructed
from the baselines of all the features defined in
[ExplanationMetadata.inputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getInputs__).

The field name of the output is determined by the key in
[ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__).
If the Model's predicted output has multiple dimensions (rank \> 1), this is
the value in the output located by
[output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__).
If there are multiple baselines, their output values are averaged.

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

### setBaselineOutputValue

Output only. Model predicted output if the input instance is constructed
from the baselines of all the features defined in
[ExplanationMetadata.inputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getInputs__).

The field name of the output is determined by the key in
[ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__).
If the Model's predicted output has multiple dimensions (rank \> 1), this is
the value in the output located by
[output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__).
If there are multiple baselines, their output values are averaged.

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

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

### getInstanceOutputValue

Output only. Model predicted output on the corresponding explanation instance. The field name of the output is
determined by the key in
[ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__).

If the Model predicted output has multiple dimensions, this is the value in
the output located by
[output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__).

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

### setInstanceOutputValue

Output only. Model predicted output on the corresponding explanation instance. The field name of the output is
determined by the key in
[ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__).

If the Model predicted output has multiple dimensions, this is the value in
the output located by
[output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__).

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

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

### getFeatureAttributions

Output only. Attributions of each explained feature. Features are extracted
from the [prediction
instances](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplainRequest#_Google_Cloud_AIPlatform_V1_ExplainRequest__getInstances__) according
to [explanation metadata for
inputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getInputs__).

The value is a struct, whose keys are the name of the feature. The values
are how much the feature in the
[instance](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplainRequest#_Google_Cloud_AIPlatform_V1_ExplainRequest__getInstances__) contributed
to the predicted result.
The format of the value is determined by the feature's input format:

- If the feature is a scalar value, the attribution value is a [floating number](https://protobuf.dev/reference/php/api-docs/floating number).
- If the feature is an array of scalar values, the attribution value is an [array](https://protobuf.dev/reference/php/api-docs/array).
- If the feature is a struct, the attribution value is a [struct](https://protobuf.dev/reference/php/api-docs/struct). The keys in the attribution value struct are the same as the keys in the feature struct. The formats of the values in the attribution struct are determined by the formats of the values in the feature struct. The [ExplanationMetadata.feature_attributions_schema_uri](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getFeatureAttributionsSchemaUri__) field, pointed to by the [ExplanationSpec](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationSpec) field of the [Endpoint.deployed_models](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Endpoint#_Google_Cloud_AIPlatform_V1_Endpoint__getDeployedModels__) object, points to the schema file that describes the features and their attribution values (if it is populated).

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

### hasFeatureAttributions

### clearFeatureAttributions

### setFeatureAttributions

Output only. Attributions of each explained feature. Features are extracted
from the [prediction
instances](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplainRequest#_Google_Cloud_AIPlatform_V1_ExplainRequest__getInstances__) according
to [explanation metadata for
inputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getInputs__).

The value is a struct, whose keys are the name of the feature. The values
are how much the feature in the
[instance](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplainRequest#_Google_Cloud_AIPlatform_V1_ExplainRequest__getInstances__) contributed
to the predicted result.
The format of the value is determined by the feature's input format:

- If the feature is a scalar value, the attribution value is a [floating number](https://protobuf.dev/reference/php/api-docs/floating number).
- If the feature is an array of scalar values, the attribution value is an [array](https://protobuf.dev/reference/php/api-docs/array).
- If the feature is a struct, the attribution value is a [struct](https://protobuf.dev/reference/php/api-docs/struct). The keys in the attribution value struct are the same as the keys in the feature struct. The formats of the values in the attribution struct are determined by the formats of the values in the feature struct. The [ExplanationMetadata.feature_attributions_schema_uri](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getFeatureAttributionsSchemaUri__) field, pointed to by the [ExplanationSpec](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationSpec) field of the [Endpoint.deployed_models](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Endpoint#_Google_Cloud_AIPlatform_V1_Endpoint__getDeployedModels__) object, points to the schema file that describes the features and their attribution values (if it is populated).

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

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

### getOutputIndex

Output only. The index that locates the explained prediction output.

If the prediction output is a scalar value, output_index is not populated.
If the prediction output has multiple dimensions, the length of the
output_index list is the same as the number of dimensions of the output.
The i-th element in output_index is the element index of the i-th dimension
of the output vector. Indices start from 0.

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

### setOutputIndex

Output only. The index that locates the explained prediction output.

If the prediction output is a scalar value, output_index is not populated.
If the prediction output has multiple dimensions, the length of the
output_index list is the same as the number of dimensions of the output.
The i-th element in output_index is the element index of the i-th dimension
of the output vector. Indices start from 0.

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

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

### getOutputDisplayName

Output only. The display name of the output identified by
[output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__). For
example, the predicted class name by a multi-classification Model.

This field is only populated iff the Model predicts display names as a
separate field along with the explained output. The predicted display name
must has the same shape of the explained output, and can be located using
output_index.

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

### setOutputDisplayName

Output only. The display name of the output identified by
[output_index](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getOutputIndex__). For
example, the predicted class name by a multi-classification Model.

This field is only populated iff the Model predicts display names as a
separate field along with the explained output. The predicted display name
must has the same shape of the explained output, and can be located using
output_index.

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

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

### getApproximationError

Output only. Error of
[feature_attributions](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getFeatureAttributions__)
caused by approximation used in the explanation method. Lower value means
more precise attributions.

- For Sampled Shapley [attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getSampledShapleyAttribution__), increasing [path_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.SampledShapleyAttribution#_Google_Cloud_AIPlatform_V1_SampledShapleyAttribution__getPathCount__) might reduce the error.
- For Integrated Gradients [attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getIntegratedGradientsAttribution__), increasing [step_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.IntegratedGradientsAttribution#_Google_Cloud_AIPlatform_V1_IntegratedGradientsAttribution__getStepCount__) might reduce the error.
- For [XRAI
  attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getXraiAttribution__), increasing [step_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.XraiAttribution#_Google_Cloud_AIPlatform_V1_XraiAttribution__getStepCount__) might reduce the error. See [this introduction](https://docs.cloud.google.com/vertex-ai/docs/explainable-ai/overview) for more information.

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

### setApproximationError

Output only. Error of
[feature_attributions](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.Attribution#_Google_Cloud_AIPlatform_V1_Attribution__getFeatureAttributions__)
caused by approximation used in the explanation method. Lower value means
more precise attributions.

- For Sampled Shapley [attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getSampledShapleyAttribution__), increasing [path_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.SampledShapleyAttribution#_Google_Cloud_AIPlatform_V1_SampledShapleyAttribution__getPathCount__) might reduce the error.
- For Integrated Gradients [attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getIntegratedGradientsAttribution__), increasing [step_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.IntegratedGradientsAttribution#_Google_Cloud_AIPlatform_V1_IntegratedGradientsAttribution__getStepCount__) might reduce the error.
- For [XRAI
  attribution](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationParameters#_Google_Cloud_AIPlatform_V1_ExplanationParameters__getXraiAttribution__), increasing [step_count](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.XraiAttribution#_Google_Cloud_AIPlatform_V1_XraiAttribution__getStepCount__) might reduce the error. See [this introduction](https://docs.cloud.google.com/vertex-ai/docs/explainable-ai/overview) for more information.

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

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

### getOutputName

Output only. Name of the explain output. Specified as the key in
[ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__).

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

### setOutputName

Output only. Name of the explain output. Specified as the key in
[ExplanationMetadata.outputs](https://docs.cloud.google.com/php/docs/reference/cloud-ai-platform/latest/V1.ExplanationMetadata#_Google_Cloud_AIPlatform_V1_ExplanationMetadata__getOutputs__).

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

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