Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1ExplanationParameters

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/aiplatform_v1beta1/classes.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb

Overview

Parameters to configure explaining for Model's predictions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1ExplanationParameters

Returns a new instance of GoogleCloudAiplatformV1beta1ExplanationParameters.



7838
7839
7840
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7838

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#examplesGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1Examples

Example-based explainability that returns the nearest neighbors from the provided dataset. Corresponds to the JSON property examples



7797
7798
7799
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7797

def examples
  @examples
end

#integrated_gradients_attributionGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1IntegratedGradientsAttribution

An attribution method that computes the Aumann-Shapley value taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1703.01365 Corresponds to the JSON property integratedGradientsAttribution



7804
7805
7806
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7804

def integrated_gradients_attribution
  @integrated_gradients_attribution
end

#output_indicesArray<Object>

If populated, only returns attributions that have output_index contained in output_indices. It must be an ndarray of integers, with the same shape of the output it's explaining. If not populated, returns attributions for top_k indices of outputs. If neither top_k nor output_indices is populated, returns the argmax index of the outputs. Only applicable to Models that predict multiple outputs (e,g, multi-class Models that predict multiple classes). Corresponds to the JSON property outputIndices

Returns:

  • (Array<Object>)


7814
7815
7816
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7814

def output_indices
  @output_indices
end

#sampled_shapley_attributionGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1SampledShapleyAttribution

An attribution method that approximates Shapley values for features that contribute to the label being predicted. A sampling strategy is used to approximate the value rather than considering all subsets of features. Corresponds to the JSON property sampledShapleyAttribution



7821
7822
7823
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7821

def sampled_shapley_attribution
  @sampled_shapley_attribution
end

#top_kFixnum

If populated, returns attributions for top K indices of outputs (defaults to 1) . Only applies to Models that predicts more than one outputs (e,g, multi-class Models). When set to -1, returns explanations for all outputs. Corresponds to the JSON property topK

Returns:

  • (Fixnum)


7828
7829
7830
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7828

def top_k
  @top_k
end

#xrai_attributionGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1XraiAttribution

An explanation method that redistributes Integrated Gradients attributions to segmented regions, taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1906. 02825 Supported only by image Models. Corresponds to the JSON property xraiAttribution



7836
7837
7838
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7836

def xrai_attribution
  @xrai_attribution
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7843
7844
7845
7846
7847
7848
7849
7850
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7843

def update!(**args)
  @examples = args[:examples] if args.key?(:examples)
  @integrated_gradients_attribution = args[:integrated_gradients_attribution] if args.key?(:integrated_gradients_attribution)
  @output_indices = args[:output_indices] if args.key?(:output_indices)
  @sampled_shapley_attribution = args[:sampled_shapley_attribution] if args.key?(:sampled_shapley_attribution)
  @top_k = args[:top_k] if args.key?(:top_k)
  @xrai_attribution = args[:xrai_attribution] if args.key?(:xrai_attribution)
end